[nautilus] window: fix file leak
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window: fix file leak
- Date: Thu, 14 Apr 2016 08:51:20 +0000 (UTC)
commit cc376b689c6b4051c94f7fd798a107887d1eaf59
Author: Carlos Soriano <csoriano gnome org>
Date: Tue Apr 12 14:23:33 2016 +0200
window: fix file leak
https://bugzilla.gnome.org/show_bug.cgi?id=712620
src/nautilus-window.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 99a2d22..ff5212c 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -538,6 +538,7 @@ real_create_slot (NautilusWindow *window,
GFile *location)
{
NautilusFile *file = NULL;
+ NautilusWindowSlot *slot;
if (location) {
file = nautilus_file_get (location);
@@ -546,10 +547,14 @@ real_create_slot (NautilusWindow *window,
* to a different location if not.
*/
if (file && nautilus_file_is_other_locations (file)) {
- return NAUTILUS_WINDOW_SLOT (nautilus_other_locations_window_slot_new (window));
+ slot = NAUTILUS_WINDOW_SLOT (nautilus_other_locations_window_slot_new (window));
} else {
- return nautilus_window_slot_new (window);
+ slot = nautilus_window_slot_new (window);
}
+
+ nautilus_file_unref (file);
+
+ return slot;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]