# HG changeset patch # User Mark Doliner # Date 1069959859 0 # Node ID c8337162c71226dbdb6bc784a99895937ef0c440 # Parent 28100686bde9f53ecfebbd3628226a0b769e7903 [gaim-migrate @ 8289] "A masterpiece" says time magazine. Rolling Stone raves, "8 stars!" That guy gave it 4 thumbs up, and he only has 2 thumbs. This fixes "[ 849022 ] "gaim-remote quit" causes seg fault" http://sourceforge.net/tracker/index.php?func=detail&aid=849022&group_id=235&atid=100235 committer: Tailor Script diff -r 28100686bde9 -r c8337162c712 plugins/gaim-remote/remote.c --- a/plugins/gaim-remote/remote.c Thu Nov 27 17:40:21 2003 +0000 +++ b/plugins/gaim-remote/remote.c Thu Nov 27 19:04:19 2003 +0000 @@ -313,7 +313,7 @@ g_source_remove(ui->inpa); g_free(ui); } - gaim_core_quit(); + g_timeout_add(0, gaim_core_quit_cb, NULL); break; case CUI_META_DETACH: uis = g_slist_remove(uis, ui); diff -r 28100686bde9 -r c8337162c712 src/core.c --- a/src/core.c Thu Nov 27 17:40:21 2003 +0000 +++ b/src/core.c Thu Nov 27 19:04:19 2003 +0000 @@ -145,6 +145,14 @@ _core = NULL; } +gboolean +gaim_core_quit_cb(gpointer unused) +{ + gaim_core_quit(); + + return FALSE; +} + const char * gaim_core_get_version(void) { diff -r 28100686bde9 -r c8337162c712 src/core.h --- a/src/core.h Thu Nov 27 17:40:21 2003 +0000 +++ b/src/core.h Thu Nov 27 19:04:19 2003 +0000 @@ -57,6 +57,20 @@ void gaim_core_quit(void); /** + * Calls gaim_core_quit(). This can be used as the function + * passed to g_timeout_add() when you want to shutdown Gaim + * in a specified amount of time. When shutting down Gaim + * from a plugin, you must use this with a timeout value of 0: + * g_timeout_add(0, gaim_core_quitcb, NULL); + * This is ensures that code from your plugin is not being + * executed when gaim_core_quit() is called. Otherwise you + * would get a core dump after gaim_core_quit() executes and + * control returns to your plugin because gaim_core_quit() frees + * all plugins. + */ +gboolean gaim_core_quit_cb(gpointer unused); + +/** * Returns the version of the core library. * * @return The version of the core library.