aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-10-16 15:58:21 -0700
committerWilmer van der Gaast <wilmer@gaast.net>2010-10-16 15:58:21 -0700
commit3fc6c32bede01e02b2ac4541c952f37dbad511b3 (patch)
tree45749ced477a300d402f779fa186eaab6ef8a794
parent9c9a29ceea6734175f9f7693ce86b3ba633f4f7b (diff)
Stop calling nogaim_init() on every incoming connection (unless we're
using libpurple). This was leaking memory and indirectly caused the bug fixed by the previous revision.
-rw-r--r--irc.c4
-rw-r--r--unix.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/irc.c b/irc.c
index 579fb8cf..3044c593 100644
--- a/irc.c
+++ b/irc.c
@@ -164,7 +164,11 @@ irc_t *irc_new( int fd )
g_free( myhost );
g_free( host );
+ /* libpurple doesn't like fork()s after initializing itself, so this
+ is the right moment to initialize it. */
+#ifdef WITH_PURPLE
nogaim_init();
+#endif
for( l = irc_plugins; l; l = l->next )
{
diff --git a/unix.c b/unix.c
index ad21c716..07215c07 100644
--- a/unix.c
+++ b/unix.c
@@ -73,6 +73,13 @@ int main( int argc, char *argv[] )
b_main_init();
+ /* libpurple doesn't like fork()s after initializing itself, so if
+ we use it, do this init a little later (in case we're running in
+ ForkDaemon mode). */
+#ifndef WITH_PURPLE
+ nogaim_init();
+#endif
+
/* Ugly Note: libotr and gnutls both use libgcrypt. libgcrypt
has a process-global config state whose initialization happpens
twice if libotr and gnutls are used together. libotr installs custom