summaryrefslogtreecommitdiff
path: root/libpurple/plugin.c
diff options
context:
space:
mode:
authorStu Tomlinson <nosnilmot@pidgin.im>2009-07-28 01:23:39 +0000
committerStu Tomlinson <nosnilmot@pidgin.im>2009-07-28 01:23:39 +0000
commit8dd42670d9d4abb533ef8f26901e40f484fa8a98 (patch)
treeb78a22898cb174bca87fd8760662cf9406c99bd3 /libpurple/plugin.c
parentf9d2c1e6a3d208f73cd42d567788b90c2992078f (diff)
downloadpidgin-8dd42670d9d4abb533ef8f26901e40f484fa8a98.tar.gz
Automatically detect if running under valgrind and don't close plugin
modules so that valgrind can resolve symbols and report where the leaks are
Diffstat (limited to 'libpurple/plugin.c')
-rw-r--r--libpurple/plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpurple/plugin.c b/libpurple/plugin.c
index d295cb92a5..da678b3258 100644
--- a/libpurple/plugin.c
+++ b/libpurple/plugin.c
@@ -33,6 +33,7 @@
#include "request.h"
#include "signals.h"
#include "util.h"
+#include "valgrind.h"
#include "version.h"
typedef struct
@@ -875,7 +876,7 @@ purple_plugin_destroy(PurplePlugin *plugin)
* 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 (!g_getenv("PURPLE_LEAKCHECK_HELP") && !RUNNING_ON_VALGRIND)
{
if (plugin->handle != NULL)
g_module_close(plugin->handle);