X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fmessage-dialog.c;h=140cea7e55a4e34f3c25061a669a13c0d2cb7297;hb=b5b474193e450bba97610065df0518c08074a7fb;hp=525fca40e22894b6ff70823efa359cf56499d153;hpb=e598cda225c4f98025ec43b72eb1a9dd691b77cd;p=pspp-builds.git diff --git a/src/ui/gui/message-dialog.c b/src/ui/gui/message-dialog.c index 525fca40..140cea7e 100644 --- a/src/ui/gui/message-dialog.c +++ b/src/ui/gui/message-dialog.c @@ -24,6 +24,7 @@ #define N_(msgid) msgid #include +#include #include #include "message-dialog.h" #include "progname.h" @@ -189,7 +190,8 @@ popup_messages (gpointer unused UNUSED) GtkTextIter end; GtkTextView *text_view; GtkLabel *label; - struct string lead, msg; + struct string lead = DS_EMPTY_INITIALIZER; + struct string msg = DS_EMPTY_INITIALIZER; int message_cnt; /* If a pointer grab is in effect, then the combination of that, and @@ -201,7 +203,6 @@ popup_messages (gpointer unused UNUSED) /* Compose the lead-in. */ message_cnt = error_cnt + warning_cnt + note_cnt; - ds_init_empty (&lead); if (dropped_messages == 0) ds_put_format ( &lead, @@ -227,7 +228,6 @@ popup_messages (gpointer unused UNUSED) /* Compose the messages. */ - ds_init_empty (&msg); while (!g_queue_is_empty (early_queue)) format_message (g_queue_pop_head (early_queue), &msg); if (dropped_messages) @@ -246,7 +246,6 @@ popup_messages (gpointer unused UNUSED) text_buffer = gtk_text_buffer_new (NULL); gtk_text_buffer_get_end_iter (text_buffer, &end); gtk_text_buffer_insert (text_buffer, &end, ds_data (&msg), ds_length (&msg)); - ds_destroy (&msg); label = GTK_LABEL (get_widget_assert (message_xml, "lead-in")); if (label == NULL) @@ -261,6 +260,9 @@ popup_messages (gpointer unused UNUSED) gtk_dialog_run (message_dialog); gtk_widget_hide (GTK_WIDGET (message_dialog)); + ds_destroy (&lead); + ds_destroy (&msg); + return FALSE; use_fallback: