[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7351 - in gnunet-gtk/src: common core include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7351 - in gnunet-gtk/src: common core include |
Date: |
Fri, 27 Jun 2008 13:26:33 -0600 (MDT) |
Author: grothoff
Date: 2008-06-27 13:26:33 -0600 (Fri, 27 Jun 2008)
New Revision: 7351
Modified:
gnunet-gtk/src/common/helper.c
gnunet-gtk/src/common/logging.c
gnunet-gtk/src/core/main.c
gnunet-gtk/src/include/gnunetgtk_common.h
Log:
handle logs during shutdown
Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c 2008-06-27 19:16:01 UTC (rev 7350)
+++ gnunet-gtk/src/common/helper.c 2008-06-27 19:26:33 UTC (rev 7351)
@@ -142,6 +142,7 @@
GNUNET_mutex_lock (sclock);
if ((saveCallsUp == GNUNET_NO) || (!GNUNET_thread_test_self (mainThread)))
{
+ GNUNET_GE_ASSERT(NULL, saveCallsUp != GNUNET_SYSERR);
call.args = args;
call.func = func;
call.sem = GNUNET_semaphore_create (0);
@@ -417,6 +418,7 @@
i = pscCount;
GNUNET_mutex_unlock (sclock);
}
+ saveCallsUp = GNUNET_SYSERR;
}
void
Modified: gnunet-gtk/src/common/logging.c
===================================================================
--- gnunet-gtk/src/common/logging.c 2008-06-27 19:16:01 UTC (rev 7350)
+++ gnunet-gtk/src/common/logging.c 2008-06-27 19:26:33 UTC (rev 7351)
@@ -32,6 +32,8 @@
static GtkWidget *infoWindowTextView;
+static int is_shutdown;
+
static void
init ()
{
@@ -127,6 +129,8 @@
va_list args;
gchar *note;
+ if (is_shutdown)
+ return;
va_start (args, txt);
note = g_strdup_vprintf (txt, args);
va_end (args);
@@ -139,9 +143,17 @@
ge_gtk_log_handler (void *ctx,
GNUNET_GE_KIND kind, const char *date, const char *msg)
{
+ if (is_shutdown)
+ return;
GNUNET_GTK_show_info_message ("%s: %s", date, msg);
}
+void
+GNUNET_GTK_shutdown_logger()
+{
+ is_shutdown = GNUNET_YES;
+}
+
struct GNUNET_GE_Context *
GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask)
{
Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c 2008-06-27 19:16:01 UTC (rev 7350)
+++ gnunet-gtk/src/core/main.c 2008-06-27 19:26:33 UTC (rev 7351)
@@ -159,8 +159,9 @@
gtk_main ();
gdk_threads_leave ();
GNUNET_GE_setDefaultContext (ectx);
+ GNUNET_GTK_shutdown_logger();
+ GNUNET_GTK_shutdown_common_library ();
GNUNET_GE_free_context (my_ctx);
- GNUNET_GTK_shutdown_common_library ();
GNUNET_fini (ectx, cfg);
return 0;
}
Modified: gnunet-gtk/src/include/gnunetgtk_common.h
===================================================================
--- gnunet-gtk/src/include/gnunetgtk_common.h 2008-06-27 19:16:01 UTC (rev
7350)
+++ gnunet-gtk/src/include/gnunetgtk_common.h 2008-06-27 19:26:33 UTC (rev
7351)
@@ -91,6 +91,9 @@
struct GNUNET_GE_Context *GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask);
+void
+GNUNET_GTK_shutdown_logger();
+
#define GNUNET_GTK_NOTIFY_LEVEL_LOW 0
#define GNUNET_GTK_NOTIFY_LEVEL_NORMAL 1
#define GNUNET_GTK_NOTIFY_LEVEL_CRITICAL 2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7351 - in gnunet-gtk/src: common core include,
gnunet <=