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:
Niels Martin Hansen 2008-01-23 23:02:26 +00:00
parent 6ade2e11ac
commit 3d9eb3eba0
1 changed files with 15 additions and 2 deletions

View File

@ -641,24 +641,32 @@ namespace Automation4 {
void LuaFeatureFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog)
{
LuaStackcheck stackcheck(L);
GetFeatureFunction(1); // 1 = processing function
assert(lua_isfunction(L, -1));
stackcheck.check(1);
// prepare function call
// 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*/);
(void) subsobj;
assert(lua_isuserdata(L, -1));
stackcheck.check(2);
// config
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
} else {
// no config so put an empty table instead
lua_newtable(L);
}
assert(lua_istable(L, -1));
stackcheck.check(3);
LuaProgressSink *ps = new LuaProgressSink(L, export_dialog, false);
ps->SetTitle(GetName());
stackcheck.check(3);
// do call
LuaThreadedCall call(L, 2, 0);
@ -668,6 +676,11 @@ namespace Automation4 {
(void) code;
//if (code) ThrowError();
stackcheck.check(0);
// Just ensure that subsobj survives until here
(void) subsobj;
delete ps;
}