diff options
author | Yi-Soo An <yisooan@gmail.com> | 2019-03-17 20:37:46 +0900 |
---|---|---|
committer | Carlos Soriano <csoriano1618+gnome@gmail.com> | 2019-03-18 15:08:59 +0000 |
commit | 179e0bfaddcf29d8a7f8074cc924d5aa45b1a954 (patch) | |
tree | b15f4a758b74fa853699bdfed8146e23b16b936f | |
parent | ec4241a80b029d0bb13d3f95a963d5f7bd5acd1a (diff) | |
download | nautilus-179e0bfaddcf29d8a7f8074cc924d5aa45b1a954.tar.gz |
bookmark-list: Fix memory leak
According to the documentation[1], GFileMonitor object must be freed
when it is not necessary. g_file_monitor_cancel() doesn't free the object.
[1]: https://developer.gnome.org/gio/stable/GFile.html#g-file-monitor-file
-rw-r--r-- | src/nautilus-bookmark-list.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c index 6a6162a0a..0f8526ba6 100644 --- a/src/nautilus-bookmark-list.c +++ b/src/nautilus-bookmark-list.c @@ -167,7 +167,7 @@ do_finalize (GObject *object) if (self->monitor != NULL) { g_file_monitor_cancel (self->monitor); - self->monitor = NULL; + g_clear_object (&self->monitor); } g_queue_free (self->pending_ops); @@ -510,7 +510,7 @@ save_file_async (NautilusBookmarkList *self) if (self->monitor != NULL) { g_file_monitor_cancel (self->monitor); - self->monitor = NULL; + g_clear_object (&self->monitor); } for (l = self->list; l; l = l->next) |