diff options
Diffstat (limited to 'src/common/logging.c')
-rw-r--r-- | src/common/logging.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/logging.c b/src/common/logging.c index 677c4783..e5ddcea8 100644 --- a/src/common/logging.c +++ b/src/common/logging.c | |||
@@ -32,6 +32,8 @@ | |||
32 | 32 | ||
33 | static GtkWidget *infoWindowTextView; | 33 | static GtkWidget *infoWindowTextView; |
34 | 34 | ||
35 | static int is_shutdown; | ||
36 | |||
35 | static void | 37 | static void |
36 | init () | 38 | init () |
37 | { | 39 | { |
@@ -127,6 +129,8 @@ GNUNET_GTK_add_log_entry (const char *txt, ...) | |||
127 | va_list args; | 129 | va_list args; |
128 | gchar *note; | 130 | gchar *note; |
129 | 131 | ||
132 | if (is_shutdown) | ||
133 | return; | ||
130 | va_start (args, txt); | 134 | va_start (args, txt); |
131 | note = g_strdup_vprintf (txt, args); | 135 | note = g_strdup_vprintf (txt, args); |
132 | va_end (args); | 136 | va_end (args); |
@@ -139,9 +143,17 @@ static void | |||
139 | ge_gtk_log_handler (void *ctx, | 143 | ge_gtk_log_handler (void *ctx, |
140 | GNUNET_GE_KIND kind, const char *date, const char *msg) | 144 | GNUNET_GE_KIND kind, const char *date, const char *msg) |
141 | { | 145 | { |
146 | if (is_shutdown) | ||
147 | return; | ||
142 | GNUNET_GTK_show_info_message ("%s: %s", date, msg); | 148 | GNUNET_GTK_show_info_message ("%s: %s", date, msg); |
143 | } | 149 | } |
144 | 150 | ||
151 | void | ||
152 | GNUNET_GTK_shutdown_logger() | ||
153 | { | ||
154 | is_shutdown = GNUNET_YES; | ||
155 | } | ||
156 | |||
145 | struct GNUNET_GE_Context * | 157 | struct GNUNET_GE_Context * |
146 | GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask) | 158 | GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask) |
147 | { | 159 | { |