[gnome-builder] GbDocumentMenuButton: be more careful about binding references
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] GbDocumentMenuButton: be more careful about binding references
- Date: Thu, 11 Dec 2014 00:10:59 +0000 (UTC)
commit 6bb1c21c956cf116494f4e53fb112756b5e657dd
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 8 14:51:44 2014 -0800
GbDocumentMenuButton: be more careful about binding references
src/documents/gb-document-menu-button.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/documents/gb-document-menu-button.c b/src/documents/gb-document-menu-button.c
index 1928c5e..6a297ae 100644
--- a/src/documents/gb-document-menu-button.c
+++ b/src/documents/gb-document-menu-button.c
@@ -311,13 +311,15 @@ gb_document_menu_button_select_document (GbDocumentMenuButton *button,
if (priv->title_binding)
{
g_binding_unbind (priv->title_binding);
- priv->title_binding = NULL;
+ if (priv->title_binding)
+ gb_clear_weak_pointer (&priv->title_binding);
}
if (priv->modified_binding)
{
g_binding_unbind (priv->modified_binding);
- priv->modified_binding = NULL;
+ if (priv->modified_binding)
+ gb_clear_weak_pointer (&priv->modified_binding);
}
gb_clear_weak_pointer (&priv->selected_document);
@@ -328,11 +330,13 @@ gb_document_menu_button_select_document (GbDocumentMenuButton *button,
priv->title_binding =
g_object_bind_property (document, "title", priv->label, "label",
G_BINDING_SYNC_CREATE);
+ gb_set_weak_pointer (priv->title_binding, &priv->title_binding);
priv->modified_binding =
g_object_bind_property (document, "modified",
priv->modified_label, "visible",
G_BINDING_SYNC_CREATE);
+ gb_set_weak_pointer (priv->title_binding, &priv->modified_binding);
value = g_get_monotonic_time () / (G_USEC_PER_SEC / 10);
g_hash_table_replace (priv->focus_time, document,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]