From cf2d2ff5d4d937152429d3a34ab97a49a2d51ad3 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 22 Apr 2007 15:45:29 +0000 Subject: [PATCH] Fixed "cannot wait for thread termination (invalid handle)" error in Auto4/Lua on wxMSW 2.8.3 by removing threading dependency in Auto4LuaScript::Create. It wasn't needed there anyway. Also removed absolute dependency on hunspell, Aegisub should just build without spellchecking support now. Finally removed requirement to have built with at least one spellchecker. (That was stupid.) Originally committed to SVN as r1112. --- aegisub/Makefile.am | 8 +++++++- aegisub/auto4_lua.cpp | 16 ++++++---------- aegisub/main.cpp | 10 +++++----- aegisub/spellchecker.cpp | 2 +- configure.ac | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/aegisub/Makefile.am b/aegisub/Makefile.am index a73bf1024..9317f672e 100644 --- a/aegisub/Makefile.am +++ b/aegisub/Makefile.am @@ -32,6 +32,12 @@ endif #AUTO4RUBY= #endif +if HAVE_HUNSPELL +HUNSPELL=spellchecker_hunspell.cpp +else +HUNSPELL= +end + aegisub_SOURCES = \ aegisublocale.cpp \ ass_attachment.cpp \ @@ -115,7 +121,7 @@ aegisub_SOURCES = \ mythes.cxx \ options.cpp \ spellchecker.cpp \ - spellchecker_hunspell.cpp \ + $(HUNSPELL) \ static_bmp.cpp \ string_codec.cpp \ subs_edit_box.cpp \ diff --git a/aegisub/auto4_lua.cpp b/aegisub/auto4_lua.cpp index 095b896c8..49f44ed3b 100644 --- a/aegisub/auto4_lua.cpp +++ b/aegisub/auto4_lua.cpp @@ -250,16 +250,12 @@ namespace Automation4 { _stackcheck.check(1); // and execute it // this is where features are registered - // this should run really fast so a progress window isn't needed - // (if it infinite-loops, scripter is an idiot and already got his punishment) - { - LuaThreadedCall call(L, 0, 0); - if (call.Wait()) { - // error occurred, assumed to be on top of Lua stack - wxString *err = new wxString(lua_tostring(L, -1), wxConvUTF8); - err->Prepend(_T("Error initialising Lua script \"") + GetPrettyFilename() + _T("\":\n\n")); - throw err->c_str(); - } + // don't thread this, as there's no point in it and it seems to break on wx 2.8.3, for some reason + if (lua_pcall(L, 0, 0, 0)) { + // error occurred, assumed to be on top of Lua stack + wxString *err = new wxString(lua_tostring(L, -1), wxConvUTF8); + err->Prepend(_T("Error initialising Lua script \"") + GetPrettyFilename() + _T("\":\n\n")); + throw err->c_str(); } _stackcheck.check(0); lua_getglobal(L, "version"); diff --git a/aegisub/main.cpp b/aegisub/main.cpp index 6413efbd5..3b56955ce 100644 --- a/aegisub/main.cpp +++ b/aegisub/main.cpp @@ -108,17 +108,17 @@ bool AegisubApp::OnInit() { locale.Init(wxLANGUAGE_DEFAULT); #endif + // Set association +#ifndef _DEBUG + RegistryAssociate(); +#endif + // Load Automation scripts global_scripts = new Automation4::AutoloadScriptManager(Options.AsText(_T("Automation Autoload Path"))); // Load export filters AssExportFilterChain::PrepareFilters(); - // Set association -#ifndef _DEBUG - RegistryAssociate(); -#endif - // Get parameter subs wxArrayString subs; for (int i=1;i