# HG changeset patch # User Christian Hammond # Date 1065314788 0 # Node ID cada5ddc21f5ee1b285eaea0f03cb69320c0ece5 # Parent a583416b6d6dded0c6febaca363eb117dfd037f0 [gaim-migrate @ 7719] Thanks to Sean for committing my patch and attempting to fix it. It gave me the motivation to figure out what was wrong, which turned out to be a g_free() in the wrong place in the GAIM_DEBUG_FATAL handling code. Now it works how it was supposed to. committer: Tailor Script diff -r a583416b6d6d -r cada5ddc21f5 src/gtkdebug.c --- a/src/gtkdebug.c Sun Oct 05 00:21:08 2003 +0000 +++ b/src/gtkdebug.c Sun Oct 05 00:46:28 2003 +0000 @@ -5,7 +5,7 @@ * gaim * * Copyright (C) 2003 Christian Hammond - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -223,20 +223,21 @@ char *new_msg = NULL; char *new_domain = NULL; - if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_ERROR) + if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR) level = GAIM_DEBUG_ERROR; - else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_CRITICAL) + else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL) level = GAIM_DEBUG_FATAL; - else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_WARNING) + else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING) level = GAIM_DEBUG_WARNING; - else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_MESSAGE) + else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE) level = GAIM_DEBUG_INFO; - else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_INFO) + else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO) level = GAIM_DEBUG_INFO; - else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_DEBUG) + else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG) level = GAIM_DEBUG_MISC; - else { - gaim_debug(GAIM_DEBUG_WARNING, "gtkdebug", + else + { + gaim_debug_warning("gtkdebug", "Unknown glib logging level in %d\n", flags); level = GAIM_DEBUG_MISC; /* This will never happen. */ @@ -248,9 +249,10 @@ if (domain != NULL) new_domain = gaim_utf8_try_convert(domain); - if (new_msg != NULL) { - gaim_debug(GAIM_DEBUG_MISC, new_domain ? new_domain : "g_log", - "%s\n", new_msg); + if (new_msg != NULL) + { + gaim_debug(level, (new_domain != NULL ? new_domain : "g_log"), + "%s\n", new_msg); g_free(new_msg); } @@ -382,7 +384,6 @@ if (level == GAIM_DEBUG_FATAL) { gchar *temp = s; - g_free(s); s = g_strdup_printf("%s", temp); g_free(temp); }