summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <darkrain42@pidgin.im>2009-07-18 05:26:23 +0000
committerPaul Aurich <darkrain42@pidgin.im>2009-07-18 05:26:23 +0000
commit7fa5f311d59af1f59e15961726ee0b0bf1836d59 (patch)
treeb57b7fcb7c6d1f1ed7688c313563de1e2b19a716
parent31ab9d92b934b285c5a0bbf2714fbf8c338a32d1 (diff)
downloadpidgin-7fa5f311d59af1f59e15961726ee0b0bf1836d59.tar.gz
Add PURPLE_LEAKCHECK_HELP environment variable. See ChangeLog.
-rw-r--r--ChangeLog8
-rw-r--r--libpurple/plugin.c12
2 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f00522ec74..a07d97f87d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,10 +20,16 @@ version 2.6.0 (??/??/2009):
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 --git a/libpurple/plugin.c b/libpurple/plugin.c
index c9baadfb40..d295cb92a5 100644
--- a/libpurple/plugin.c
+++ b/libpurple/plugin.c
@@ -870,8 +870,16 @@ purple_plugin_destroy(PurplePlugin *plugin)
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
{