From 0f4443efd01efbd6e31e7da4d606a81ccff11e59 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 12 Sep 2005 16:34:42 +0000 Subject: [PATCH] fixed reference count bug (also comitted to unreal3_2_fixes). --- src/modules.c | 2 ++ src/s_bsd.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/modules.c b/src/modules.c index acffc88db..f9e4740e9 100644 --- a/src/modules.c +++ b/src/modules.c @@ -560,7 +560,9 @@ void Unload_all_loaded_modules(void) } DelListItem(mi,Modules); irc_dlclose(mi->dll); +#ifndef DEBUGMODE remove(mi->tmp_file); +#endif MyFree(mi->tmp_file); MyFree(mi); } diff --git a/src/s_bsd.c b/src/s_bsd.c index 2b1bf3919..5975b10b5 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -2360,6 +2360,11 @@ int connect_server(ConfigItem_link *aconf, aClient *by, struct hostent *hp) char *s; int errtmp, len; +#ifdef DEBUGMODE + sendto_realops("connect_server() called with aconf %p, refcount: %d, TEMP: %s", + aconf, aconf->refcount, aconf->flag.temporary ? "YES" : "NO"); +#endif + if (aconf->options & CONNECT_NODNSCACHE) { /* Remove "cache" if link::options::nodnscache is set */ memset(&aconf->ipnum, '\0', sizeof(struct IN_ADDR)); @@ -2441,6 +2446,10 @@ int connect_server(ConfigItem_link *aconf, aClient *by, struct hostent *hp) (void)make_server(cptr); cptr->serv->conf = aconf; cptr->serv->conf->refcount++; +#ifdef DEBUGMODE + sendto_realops("connect_server() CONTINUED (%s:%d), aconf %p, refcount: %d, TEMP: %s", + __FILE__, __LINE__, aconf, aconf->refcount, aconf->flag.temporary ? "YES" : "NO"); +#endif Debug((DEBUG_ERROR, "reference count for %s (%s) is now %d", cptr->name, cptr->serv->conf->servername, cptr->serv->conf->refcount)); if (by && IsPerson(by))