forked from mia/Aegisub
Don't throw exceptions from destructors
This commit is contained in:
parent
faad79479f
commit
b1cd2db023
1 changed files with 5 additions and 2 deletions
|
@ -96,7 +96,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~parser() {
|
void check_done() const {
|
||||||
if (tkn_idx != tkns.size())
|
if (tkn_idx != tkns.size())
|
||||||
throw SubtitleFormatParseError("Malformed style: too many fields", 0);
|
throw SubtitleFormatParseError("Malformed style: too many fields", 0);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
AssStyle::AssStyle(wxString const& rawData, int version) {
|
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();
|
name = p.next_str();
|
||||||
font = p.next_str();
|
font = p.next_str();
|
||||||
|
@ -201,6 +202,8 @@ AssStyle::AssStyle(wxString const& rawData, int version) {
|
||||||
|
|
||||||
encoding = p.next_int();
|
encoding = p.next_int();
|
||||||
|
|
||||||
|
p.check_done();
|
||||||
|
|
||||||
UpdateData();
|
UpdateData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue