mirror of https://github.com/odrling/Aegisub
Don't throw exceptions from destructors
This commit is contained in:
parent
faad79479f
commit
b1cd2db023
|
@ -96,7 +96,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
~parser() {
|
||||
void check_done() const {
|
||||
if (tkn_idx != tkns.size())
|
||||
throw SubtitleFormatParseError("Malformed style: too many fields", 0);
|
||||
}
|
||||
|
@ -136,7 +136,8 @@ public:
|
|||
}
|
||||
|
||||
AssStyle::AssStyle(wxString const& rawData, int version) {
|
||||
parser p(from_wx(rawData));
|
||||
std::string str(from_wx(rawData));
|
||||
parser p(str);
|
||||
|
||||
name = p.next_str();
|
||||
font = p.next_str();
|
||||
|
@ -201,6 +202,8 @@ AssStyle::AssStyle(wxString const& rawData, int version) {
|
|||
|
||||
encoding = p.next_int();
|
||||
|
||||
p.check_done();
|
||||
|
||||
UpdateData();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue