changeset 7152:cada5ddc21f5

[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 <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 05 Oct 2003 00:46:28 +0000
parents a583416b6d6d
children d4bb24ecc6aa
files src/gtkdebug.c
diffstat 1 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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 <chipx86@gnupdate.org>
- * 
+ *
  * 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("<b>%s</b>", temp);
 			g_free(temp);
 		}