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");
{
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
/* 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)