Kaydet (Commit) d4700f09 authored tarafından Enrico Tröger's avatar Enrico Tröger

Properly clean up the logging mechanism.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3878 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 29574a35
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
"Open with Geany" context menu item. "Open with Geany" context menu item.
* plugins/splitwindow.c: * plugins/splitwindow.c:
Avoid using deprecated GTK API. Avoid using deprecated GTK API.
* src/log.c, src/main.c:
Properly clean up the logging mechanism.
2009-06-18 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2009-06-18 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
...@@ -74,18 +74,22 @@ void geany_debug(gchar const *format, ...) ...@@ -74,18 +74,22 @@ void geany_debug(gchar const *format, ...)
static void handler_print(const gchar *msg) static void handler_print(const gchar *msg)
{ {
printf("%s\n", msg); printf("%s\n", msg);
g_string_append_printf(log_buffer, "%s\n", msg); if (G_LIKELY(log_buffer != NULL))
{
update_dialog(); g_string_append_printf(log_buffer, "%s\n", msg);
update_dialog();
}
} }
static void handler_printerr(const gchar *msg) static void handler_printerr(const gchar *msg)
{ {
fprintf(stderr, "%s\n", msg); fprintf(stderr, "%s\n", msg);
g_string_append_printf(log_buffer, "%s\n", msg); if (G_LIKELY(log_buffer != NULL))
{
update_dialog(); g_string_append_printf(log_buffer, "%s\n", msg);
update_dialog();
}
} }
...@@ -208,5 +212,8 @@ void log_show_debug_messages_dialog(void) ...@@ -208,5 +212,8 @@ void log_show_debug_messages_dialog(void)
void log_finalize(void) void log_finalize(void)
{ {
g_log_set_default_handler(g_log_default_handler, NULL);
g_string_free(log_buffer, TRUE); g_string_free(log_buffer, TRUE);
log_buffer = NULL;
} }
...@@ -1109,7 +1109,6 @@ void main_quit() ...@@ -1109,7 +1109,6 @@ void main_quit()
encodings_finalize(); encodings_finalize();
toolbar_finalize(); toolbar_finalize();
configuration_finalize(); configuration_finalize();
/* must be last */
log_finalize(); log_finalize();
tm_workspace_free(TM_WORK_OBJECT(app->tm_workspace)); tm_workspace_free(TM_WORK_OBJECT(app->tm_workspace));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment