*** empty log message ***

This commit is contained in:
Marc Lehmann 1999-04-14 19:51:49 +00:00
parent b809f23b63
commit fc1de7b4ea
8 changed files with 220 additions and 115 deletions

View File

@ -1,3 +1,8 @@
Wed Apr 14 14:27:51 CEST 1999 Marc Lehmann <pcg@goof.com>
* app/app_procs.c, app/module_db.[ch]: call module_unload functions on all
modules when we quit (don't close it, though).
Wed Apr 14 00:27:53 BST 1999 Andy Thomas <alt@gimp.org> Wed Apr 14 00:27:53 BST 1999 Andy Thomas <alt@gimp.org>
Changed:- Changed:-

View File

@ -613,6 +613,7 @@ app_exit_finish (void)
message_handler = CONSOLE; message_handler = CONSOLE;
we_are_exiting = TRUE; we_are_exiting = TRUE;
module_db_free ();
device_status_free (); device_status_free ();
lc_dialog_free (); lc_dialog_free ();
gdisplays_delete (); gdisplays_delete ();

View File

@ -140,7 +140,37 @@ module_db_init (void)
#endif #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 * GtkWidget *
module_db_browser_new (void) module_db_browser_new (void)

View File

@ -23,6 +23,9 @@
/* Load any modules we find on the module-path set in the gimprc */ /* Load any modules we find on the module-path set in the gimprc */
void module_db_init (void); 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); GtkWidget *module_db_browser_new (void);

View File

@ -140,7 +140,37 @@ module_db_init (void)
#endif #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 * GtkWidget *
module_db_browser_new (void) module_db_browser_new (void)

View File

@ -23,6 +23,9 @@
/* Load any modules we find on the module-path set in the gimprc */ /* Load any modules we find on the module-path set in the gimprc */
void module_db_init (void); 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); GtkWidget *module_db_browser_new (void);

View File

@ -140,7 +140,37 @@ module_db_init (void)
#endif #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 * GtkWidget *
module_db_browser_new (void) module_db_browser_new (void)

View File

@ -23,6 +23,9 @@
/* Load any modules we find on the module-path set in the gimprc */ /* Load any modules we find on the module-path set in the gimprc */
void module_db_init (void); 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); GtkWidget *module_db_browser_new (void);