mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Fix #558, very fail fix. Unwrap function call from assert() and it's suddenly called a lot more often in release builds.
Originally committed to SVN as r1825.
This commit is contained in:
parent
6ade2e11ac
commit
3d9eb3eba0
@ -641,24 +641,32 @@ namespace Automation4 {
|
|||||||
|
|
||||||
void LuaFeatureFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog)
|
void LuaFeatureFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog)
|
||||||
{
|
{
|
||||||
|
LuaStackcheck stackcheck(L);
|
||||||
|
|
||||||
GetFeatureFunction(1); // 1 = processing function
|
GetFeatureFunction(1); // 1 = processing function
|
||||||
assert(lua_isfunction(L, -1));
|
assert(lua_isfunction(L, -1));
|
||||||
|
stackcheck.check(1);
|
||||||
|
|
||||||
// prepare function call
|
// prepare function call
|
||||||
// subtitles (undo doesn't make sense in exported subs, in fact it'll totally break the undo system)
|
// subtitles (undo doesn't make sense in exported subs, in fact it'll totally break the undo system)
|
||||||
LuaAssFile *subsobj = new LuaAssFile(L, subs, true/*allow modifications*/, false/*disallow undo*/);
|
LuaAssFile *subsobj = new LuaAssFile(L, subs, true/*allow modifications*/, false/*disallow undo*/);
|
||||||
(void) subsobj;
|
assert(lua_isuserdata(L, -1));
|
||||||
|
stackcheck.check(2);
|
||||||
// config
|
// config
|
||||||
if (has_config && config_dialog) {
|
if (has_config && config_dialog) {
|
||||||
assert(config_dialog->LuaReadBack(L) == 1);
|
int results_produced = config_dialog->LuaReadBack(L);
|
||||||
|
assert(results_produced == 1);
|
||||||
// TODO, write back stored options here
|
// TODO, write back stored options here
|
||||||
} else {
|
} else {
|
||||||
// no config so put an empty table instead
|
// no config so put an empty table instead
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
}
|
}
|
||||||
|
assert(lua_istable(L, -1));
|
||||||
|
stackcheck.check(3);
|
||||||
|
|
||||||
LuaProgressSink *ps = new LuaProgressSink(L, export_dialog, false);
|
LuaProgressSink *ps = new LuaProgressSink(L, export_dialog, false);
|
||||||
ps->SetTitle(GetName());
|
ps->SetTitle(GetName());
|
||||||
|
stackcheck.check(3);
|
||||||
|
|
||||||
// do call
|
// do call
|
||||||
LuaThreadedCall call(L, 2, 0);
|
LuaThreadedCall call(L, 2, 0);
|
||||||
@ -668,6 +676,11 @@ namespace Automation4 {
|
|||||||
(void) code;
|
(void) code;
|
||||||
//if (code) ThrowError();
|
//if (code) ThrowError();
|
||||||
|
|
||||||
|
stackcheck.check(0);
|
||||||
|
|
||||||
|
// Just ensure that subsobj survives until here
|
||||||
|
(void) subsobj;
|
||||||
|
|
||||||
delete ps;
|
delete ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user