Commit fc1de7b4 authored by Marc Lehmann's avatar Marc Lehmann
Browse files

*** empty log message ***

parent b809f23b
This diff is collapsed.
......@@ -613,6 +613,7 @@ app_exit_finish (void)
message_handler = CONSOLE;
we_are_exiting = TRUE;
module_db_free ();
device_status_free ();
lc_dialog_free ();
gdisplays_delete ();
......
......@@ -140,7 +140,37 @@ module_db_init (void)
#endif
}
/* not closing the module at exit time is safer and faster. */
static void
free_a_single_module_cb (void *data)
{
module_info *mod = data;
g_return_if_fail (mod->state == ST_UNLOAD_REQUESTED);
mod->info = NULL;
mod->state = ST_UNLOADED_OK;
}
static void
free_a_single_module (gpointer data, gpointer user_data)
{
module_info *mod = data;
if (mod->module && mod->unload && mod->state == ST_LOADED_OK)
{
mod->state = ST_UNLOAD_REQUESTED;
gimp_module_ref (mod);
mod->unload (mod->info->shutdown_data, free_a_single_module_cb, mod);
}
}
void
module_db_free (void)
{
gimp_set_foreach (modules, free_a_single_module, NULL);
}
GtkWidget *
module_db_browser_new (void)
......
......@@ -23,6 +23,9 @@
/* Load any modules we find on the module-path set in the gimprc */
void module_db_init (void);
/* Unload all modules, in case a module needs some cleanups */
void module_db_free (void);
GtkWidget *module_db_browser_new (void);
......
......@@ -140,7 +140,37 @@ module_db_init (void)
#endif
}
/* not closing the module at exit time is safer and faster. */
static void
free_a_single_module_cb (void *data)
{
module_info *mod = data;
g_return_if_fail (mod->state == ST_UNLOAD_REQUESTED);
mod->info = NULL;
mod->state = ST_UNLOADED_OK;
}
static void
free_a_single_module (gpointer data, gpointer user_data)
{
module_info *mod = data;
if (mod->module && mod->unload && mod->state == ST_LOADED_OK)
{
mod->state = ST_UNLOAD_REQUESTED;
gimp_module_ref (mod);
mod->unload (mod->info->shutdown_data, free_a_single_module_cb, mod);
}
}
void
module_db_free (void)
{
gimp_set_foreach (modules, free_a_single_module, NULL);
}
GtkWidget *
module_db_browser_new (void)
......
......@@ -23,6 +23,9 @@
/* Load any modules we find on the module-path set in the gimprc */
void module_db_init (void);
/* Unload all modules, in case a module needs some cleanups */
void module_db_free (void);
GtkWidget *module_db_browser_new (void);
......
......@@ -140,7 +140,37 @@ module_db_init (void)
#endif
}
/* not closing the module at exit time is safer and faster. */
static void
free_a_single_module_cb (void *data)
{
module_info *mod = data;
g_return_if_fail (mod->state == ST_UNLOAD_REQUESTED);
mod->info = NULL;
mod->state = ST_UNLOADED_OK;
}
static void
free_a_single_module (gpointer data, gpointer user_data)
{
module_info *mod = data;
if (mod->module && mod->unload && mod->state == ST_LOADED_OK)
{
mod->state = ST_UNLOAD_REQUESTED;
gimp_module_ref (mod);
mod->unload (mod->info->shutdown_data, free_a_single_module_cb, mod);
}
}
void
module_db_free (void)
{
gimp_set_foreach (modules, free_a_single_module, NULL);
}
GtkWidget *
module_db_browser_new (void)
......
......@@ -23,6 +23,9 @@
/* Load any modules we find on the module-path set in the gimprc */
void module_db_init (void);
/* Unload all modules, in case a module needs some cleanups */
void module_db_free (void);
GtkWidget *module_db_browser_new (void);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment