mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
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…
x
Reference in New Issue
Block a user