+2008-02-19 Ben Pfaff <blp@gnu.org>
+
+ * message-dialog.c (popup_messages): Always destroy `msg' and
+ `lead' strings, avoiding a memory leak. Thanks to John Darrington
+ for reporting the problem.
+
2008-02-19 John Darrington <john@darrington.wattle.id.au>
* dict-display.c: Display names of variables in dialog box
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
/* Compose the lead-in. */
message_cnt = error_cnt + warning_cnt + note_cnt;
- ds_init_empty (&lead);
if (dropped_messages == 0)
ds_put_format (
&lead,
/* 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)
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)
gtk_dialog_run (message_dialog);
gtk_widget_hide (GTK_WIDGET (message_dialog));
+ ds_destroy (&lead);
+ ds_destroy (&msg);
+
return FALSE;
use_fallback: