comparison libpurple/plugin.c @ 27711:c1314a6cefcf

Automatically detect if running under valgrind and don't close plugin modules so that valgrind can resolve symbols and report where the leaks are
author Stu Tomlinson <stu@nosnilmot.com>
date Tue, 28 Jul 2009 01:23:39 +0000
parents 386265b369c9
children b131c68822ce
comparison
equal deleted inserted replaced
27710:6e3c83e1057c 27711:c1314a6cefcf
31 #include "prefs.h" 31 #include "prefs.h"
32 #include "prpl.h" 32 #include "prpl.h"
33 #include "request.h" 33 #include "request.h"
34 #include "signals.h" 34 #include "signals.h"
35 #include "util.h" 35 #include "util.h"
36 #include "valgrind.h"
36 #include "version.h" 37 #include "version.h"
37 38
38 typedef struct 39 typedef struct
39 { 40 {
40 GHashTable *commands; 41 GHashTable *commands;
873 /* 874 /*
874 * I find it extremely useful to do this when using valgrind, as 875 * I find it extremely useful to do this when using valgrind, as
875 * it keeps all the plugins open, meaning that valgrind is able to 876 * it keeps all the plugins open, meaning that valgrind is able to
876 * resolve symbol names in leak traces from plugins. 877 * resolve symbol names in leak traces from plugins.
877 */ 878 */
878 if (!g_getenv("PURPLE_LEAKCHECK_HELP")) 879 if (!g_getenv("PURPLE_LEAKCHECK_HELP") && !RUNNING_ON_VALGRIND)
879 { 880 {
880 if (plugin->handle != NULL) 881 if (plugin->handle != NULL)
881 g_module_close(plugin->handle); 882 g_module_close(plugin->handle);
882 } 883 }
883 } 884 }