Commit b2fff0dd authored by Xan Lopez's avatar Xan Lopez

ephy-embed: do not listen to status updates after dispose

Otherwise we might crash updating a dead statusbar widget.

https://bugzilla.gnome.org/show_bug.cgi?id=668171
parent 19171bd7
......@@ -88,6 +88,8 @@ struct _EphyEmbedPrivate
guint pop_statusbar_later_source_id;
guint clear_progress_source_id;
gulong status_handler_id;
};
G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_BOX)
......@@ -275,6 +277,13 @@ ephy_embed_dispose (GObject *object)
priv->pop_statusbar_later_source_id = 0;
}
/* Do not listen to status message notifications anymore, if we try
* to update the statusbar after dispose we might crash. */
if (priv->status_handler_id) {
g_signal_handler_disconnect (priv->web_view, embed->priv->status_handler_id);
priv->status_handler_id = 0;
}
G_OBJECT_CLASS (ephy_embed_parent_class)->dispose (object);
}
......@@ -611,9 +620,12 @@ ephy_embed_constructed (GObject *object)
"signal::resource-request-starting", G_CALLBACK (resource_request_starting_cb), embed,
"signal::download-requested", G_CALLBACK (download_requested_cb), embed,
"signal::notify::zoom-level", G_CALLBACK (zoom_changed_cb), embed,
"signal::notify::status-message", G_CALLBACK (status_message_notify_cb), embed,
NULL);
embed->priv->status_handler_id = g_signal_connect (web_view, "notify::status-message",
G_CALLBACK (status_message_notify_cb),
embed);
/* Window features */
window_features = webkit_web_view_get_window_features (web_view);
g_object_connect (window_features,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment