From: rodin Date: Sun, 18 Apr 2010 14:38:10 +0000 (+0000) Subject: Fixed x86-64 closing bug #44 X-Git-Tag: v0.9~227 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=3cae3fd0309a0822c9dfc46fad88e32174e4acf7;p=projects%2Fchimara%2Fchimara.git Fixed x86-64 closing bug #44 --- diff --git a/libchimara/abort.c b/libchimara/abort.c index 8eb21da..7959408 100644 --- a/libchimara/abort.c +++ b/libchimara/abort.c @@ -46,7 +46,7 @@ abort_glk(void) shutdown_glk_pre(); shutdown_glk_post(); /* If program is terminated by g_thread_exit() instead of returning from the - glk_main() function, then the line in glk_enter() where the "stopped" + glk_main() function, then the line in glk_exit() where the "stopped" signal is emitted will not be reached. So we have to emit it here. */ if(!glk_data->in_startup) g_signal_emit_by_name(glk_data->self, "stopped"); diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index e585165..b6b88c7 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -579,11 +579,6 @@ chimara_glk_stopped(ChimaraGlk *self) { CHIMARA_GLK_USE_PRIVATE(self, priv); priv->running = FALSE; - - /* Free the plugin */ - if( priv->program && !g_module_close(priv->program) ) - g_warning( "Error closing module: %s", g_module_error() ); - priv->program = NULL; } static void @@ -1159,8 +1154,12 @@ chimara_glk_run(ChimaraGlk *glk, const gchar *plugin, int argc, char *argv[], GE /* COMPAT: avoid usage of slices */ struct StartupData *startup = g_new0(struct StartupData,1); - /* Open the module to run */ g_assert( g_module_supported() ); + /* If there is already a module loaded, free it first -- you see, we want to + * keep modules loaded as long as possible to avoid crashes in stack unwinding */ + if( priv->program && !g_module_close(priv->program) ) + g_warning( "Error closing module :%s", g_module_error() ); + /* Open the module to run */ priv->program = g_module_open(plugin, G_MODULE_BIND_LAZY); if(!priv->program)