summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2018-07-08 16:02:14 -0400
committerlukefromdc <[email protected]>2018-07-11 19:20:53 -0400
commitf9bae2f377579baf4715c851661879e07291e17a (patch)
tree666d3752bdb26a79173c35559bd9d1fb359fcf03 /src
parentacdb7e2900181125190986af39dda61451f557a5 (diff)
downloadcaja-f9bae2f377579baf4715c851661879e07291e17a.tar.bz2
caja-f9bae2f377579baf4715c851661879e07291e17a.tar.xz
pathbar: increase reference count of path in update_button_types
Stop crash and g_object_ref: assertion 'G_IS_OBJECT (object)' failed warnings on toggling desktop_is_home_dir and on some window opening events
Diffstat (limited to 'src')
-rw-r--r--src/caja-pathbar.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index db854cab..b5f7a526 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -169,13 +169,17 @@ update_button_types (CajaPathBar *path_bar)
button_data = BUTTON_DATA (list->data);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button)))
{
- path = button_data->path;
+ /*Increase the reference count on path so it does not get cleared
+ *by caja_path_bar_clear_buttons during caja_path_bar_update_path
+ */
+ path = g_object_ref (button_data->path);
break;
}
}
if (path != NULL)
{
caja_path_bar_update_path (path_bar, path, TRUE);
+ g_object_unref (path);
}
}
@@ -2103,6 +2107,7 @@ caja_path_bar_update_path (CajaPathBar *path_bar,
}
path_bar->current_path = g_object_ref (file_path);
+
path_bar->current_button_data = current_button_data;
return result;