aboutsummaryrefslogtreecommitdiff
path: root/src/common/logging.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2006-11-30 17:42:39 +0000
committerChristian Grothoff <christian@grothoff.org>2006-11-30 17:42:39 +0000
commit316efb02c11676c2c52783f9f9e3931b7c5b76c6 (patch)
treeeadf7e100cd7619f80097914125ec3a27c6090ec /src/common/logging.c
parent7257f405932eef9a658d2b5e9b5811c7ce62e31c (diff)
downloadgnunet-gtk-316efb02c11676c2c52783f9f9e3931b7c5b76c6.tar.gz
gnunet-gtk-316efb02c11676c2c52783f9f9e3931b7c5b76c6.zip
leaks
Diffstat (limited to 'src/common/logging.c')
-rw-r--r--src/common/logging.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/common/logging.c b/src/common/logging.c
index d49298fd..aad69f96 100644
--- a/src/common/logging.c
+++ b/src/common/logging.c
@@ -30,6 +30,28 @@
30#include <glib.h> 30#include <glib.h>
31#include <gmodule.h> 31#include <gmodule.h>
32 32
33static GtkWidget * infoWindow;
34
35static GtkWidget * infoWindowTextView;
36
37static GladeXML * statusXML;
38
39static void init() {
40 if (statusXML != NULL)
41 return;
42 statusXML
43 = glade_xml_new(getGladeFileName(),
44 "statusWindow",
45 PACKAGE_NAME);
46 infoWindow
47 = glade_xml_get_widget(statusXML,
48 "statusWindow");
49 infoWindowTextView
50 = glade_xml_get_widget(statusXML,
51 "messageWindowTextView");
52 connectGladeWithPlugins(statusXML);
53}
54
33/** 55/**
34 * Closure for doInfoMessage. 56 * Closure for doInfoMessage.
35 */ 57 */
@@ -46,6 +68,7 @@ static void * doInfoMessage(void * args) {
46 GtkTextIter iter; 68 GtkTextIter iter;
47 GtkTextBuffer * buffer; 69 GtkTextBuffer * buffer;
48 70
71 init();
49 if (info->doPopup==YES) 72 if (info->doPopup==YES)
50 gtk_widget_show(infoWindow); 73 gtk_widget_show(infoWindow);
51 buffer 74 buffer
@@ -83,9 +106,10 @@ static void * saveAddLogEntry(void * args) {
83 static int once = 1; 106 static int once = 1;
84 static guint id; 107 static guint id;
85 108
109 init();
86 if (once) { 110 if (once) {
87 once = 0; 111 once = 0;
88 s = glade_xml_get_widget(mainXML, 112 s = glade_xml_get_widget(getMainXML(),
89 "statusbar"); 113 "statusbar");
90 id = gtk_statusbar_get_context_id(GTK_STATUSBAR(s), 114 id = gtk_statusbar_get_context_id(GTK_STATUSBAR(s),
91 "LOG"); 115 "LOG");
@@ -118,3 +142,11 @@ void addLogEntry(const char * txt,
118 g_free(note); 142 g_free(note);
119} 143}
120 144
145void __attribute__ ((destructor)) gnunet_crypto_ltdl_fini() {
146 if (statusXML != NULL) {
147 gtk_widget_destroy(infoWindow);
148 infoWindow = NULL;
149 UNREF(statusXML);
150 statusXML = NULL;
151 }
152}