[gnome-builder] devhelp-panel: fix active view cleanup
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] devhelp-panel: fix active view cleanup
- Date: Tue, 29 Sep 2015 18:49:29 +0000 (UTC)
commit 1d03efb470a338f2008c33333e4abd9fa69efd8d
Author: Sebastien Lafargue <slafargue gnome org>
Date: Tue Sep 29 18:11:35 2015 +0200
devhelp-panel: fix active view cleanup
devhelp maintain a weak pointer on active view but
for the last view, the active-view signal is called
before the weak pointer and we disconnect and unref
on an already destroyed object.
plugins/devhelp/gb-devhelp-panel.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/devhelp/gb-devhelp-panel.c b/plugins/devhelp/gb-devhelp-panel.c
index 6682780..d4cb3e7 100644
--- a/plugins/devhelp/gb-devhelp-panel.c
+++ b/plugins/devhelp/gb-devhelp-panel.c
@@ -106,14 +106,18 @@ notify_active_view_cb (GbDevhelpPanel *self,
g_assert (GB_IS_DEVHELP_PANEL (self));
g_assert (GB_IS_WORKBENCH (workbench));
- if (self->current_view)
+ view = gb_workbench_get_active_view (workbench);
+
+ /* If the active view is NULL, the current view is already destroyed but
+ * the weak pointer has not been call yet so self->current_view is not NULL
+ */
+ if (view != NULL && self->current_view)
{
g_signal_handler_disconnect (self->current_view, self->current_view_handler);
self->current_view_handler = 0;
ide_clear_weak_pointer (&self->current_view);
}
- view = gb_workbench_get_active_view (workbench);
if (!GB_IS_EDITOR_VIEW (view))
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]