# HG changeset patch # User Paul Aurich # Date 1247894783 0 # Node ID 386265b369c900b0859380e6c74db8e12efbc1b9 # Parent 37b668b8d6c102e90b3f96e296e3cf5d1d80c14f Add PURPLE_LEAKCHECK_HELP environment variable. See ChangeLog. diff -r 37b668b8d6c1 -r 386265b369c9 ChangeLog --- a/ChangeLog Sat Jul 18 05:08:25 2009 +0000 +++ b/ChangeLog Sat Jul 18 05:26:23 2009 +0000 @@ -20,10 +20,16 @@ PURPLE_GNUTLS_DEBUG environment variable, which is an integer between 0 and 9 (higher is more verbose). Higher values may reveal sensitive information. - * PURPLE_VERBOSE_DEBUG environment variable. Currently this is an "on" or + * PURPLE_VERBOSE_DEBUG environment variable. Currently, this is an "on" or "off" variable. Set it to any value to turn it on and unset it to turn it off. This will optionally be used to only show less useful debug information on an as-needed basis. + * PURPLE_LEAKCHECK_HELP environment variable. Currently, this is an "on" + or "off" variable. Set it to any value to turn it on and unset it to + turn it off. This will be used to perform various actions that are + useful when running libpurple inside of Valgrind or similar programs. + Currently, it keeps plugins in memory, allowing Valgrind to perform + symbol resolution of leak traces at shutdown. * Add support for receiving handwritten (ink) messages on MSN. * Don't do IPv6 address lookups if the computer does not have an IPv6 address configured. diff -r 37b668b8d6c1 -r 386265b369c9 libpurple/plugin.c --- a/libpurple/plugin.c Sat Jul 18 05:08:25 2009 +0000 +++ b/libpurple/plugin.c Sat Jul 18 05:26:23 2009 +0000 @@ -870,8 +870,16 @@ if (plugin->info != NULL && plugin->info->destroy != NULL) plugin->info->destroy(plugin); - if (plugin->handle != NULL) - g_module_close(plugin->handle); + /* + * I find it extremely useful to do this when using valgrind, as + * it keeps all the plugins open, meaning that valgrind is able to + * resolve symbol names in leak traces from plugins. + */ + if (!g_getenv("PURPLE_LEAKCHECK_HELP")) + { + if (plugin->handle != NULL) + g_module_close(plugin->handle); + } } else {