summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-11-13 18:55:54 +0100
committerCarlos Soriano <csoriano@gnome.org>2015-11-13 18:58:18 +0100
commitc22b545dcdb3ad9f8ab6daf81215d54ce95aa5cb (patch)
tree72ad43e3d3e37e937dbee6e3e2126c7d89e04ee2 /src
parentf101c34c3dfe555d237c0a67876fc478ca8772a9 (diff)
downloadnautilus-c22b545dcdb3ad9f8ab6daf81215d54ce95aa5cb.tar.gz
nautilus-places-view: sink the reference on creation
Last patch now makes view reference counting works, however NautilusFilesView sink the ref on creation, and NautilusPlacesView was not, making NautilusPlacesView holding a reference less than other views and making nautilus crash. Follow what other views do and sink the reference.
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-places-view.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 1d5db8bdd..a356263c0 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -352,5 +352,12 @@ nautilus_places_view_init (NautilusPlacesView *self)
NautilusPlacesView *
nautilus_places_view_new (void)
{
- return g_object_new (NAUTILUS_TYPE_PLACES_VIEW, NULL);
+ NautilusPlacesView *view;
+
+ view = g_object_new (NAUTILUS_TYPE_PLACES_VIEW, NULL);
+ if (g_object_is_floating (view)) {
+ g_object_ref_sink (view);
+ }
+
+ return view;
}