From 60344f7a79d41ae6f0af41dd786a6918493580bd Mon Sep 17 00:00:00 2001 From: Monsta Date: Sun, 9 Nov 2014 13:01:35 +0300 Subject: gajim plugin: don't leak memory --- sendto/plugins/gajim/gajim.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sendto') diff --git a/sendto/plugins/gajim/gajim.c b/sendto/plugins/gajim/gajim.c index bb00d1d..93aff8a 100644 --- a/sendto/plugins/gajim/gajim.c +++ b/sendto/plugins/gajim/gajim.c @@ -386,16 +386,18 @@ static void show_error (const gchar *title, const gchar *message) { GtkWidget *dialog; - + dialog = gtk_message_dialog_new_with_markup(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, NULL); - gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), - g_markup_printf_escaped("%s\n\n%s", title, message)); + + gchar *msg = g_markup_printf_escaped("%s\n\n%s", title, message); + gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), msg); + g_free (msg); + gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - + gtk_widget_destroy (dialog); } static gboolean -- cgit v1.2.1