/pidgin/main: 8755f8900cb4: Gtk webview inspector: fix a crash

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Oct 7 09:33:42 EDT 2013


Changeset: 8755f8900cb4366f05c5186f3c55f0b5db871fee
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-10-07 15:33 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/8755f8900cb4

Description:

Gtk webview inspector: fix a crash

diffstat:

 pidgin/gtkwebview.c |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (29 lines):

diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -846,6 +846,15 @@ webview_inspector_inspect_element(GtkWid
 	webkit_web_inspector_inspect_node(data->inspector, data->node);
 }
 
+static void
+webview_inspector_destroy(GtkWindow *window, GtkWebViewPriv *priv)
+{
+	g_return_if_fail(priv->inspector_win == window);
+
+	priv->inspector_win = NULL;
+	priv->inspector_view = NULL;
+}
+
 static WebKitWebView *
 webview_inspector_create(WebKitWebInspector *inspector,
 	WebKitWebView *webview, gpointer _unused)
@@ -863,6 +872,9 @@ webview_inspector_create(WebKitWebInspec
 	gtk_container_add(GTK_CONTAINER(priv->inspector_win),
 		GTK_WIDGET(priv->inspector_view));
 
+	g_signal_connect(priv->inspector_win, "destroy",
+		G_CALLBACK(webview_inspector_destroy), priv);
+
 	return priv->inspector_view;
 }
 



More information about the Commits mailing list