summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2018-10-13 21:39:46 +0000
committerErnestas Kulik <ernestas.kulik@gmail.com>2018-10-28 20:52:38 +0000
commitaaba2b937f7bf6e26d7acbb8a98b185bd6b83c15 (patch)
tree3b6fa0c2d8b0ad1a37dc7f3fc35aa1898d74ee69
parent6679353548e52fe5679f6c2008a569c922dac835 (diff)
downloadnautilus-aaba2b937f7bf6e26d7acbb8a98b185bd6b83c15.tar.gz
search-engine-recent: Avoid premature destruction
Since commit 4c6d4eea995a66e80fb21ee83b66954d1ce71c08, we haven't been increasing the reference count of the recent search engine when not creating a thread. But the idle callback unref's it regardless, which causes the recent engine object to be destroyed while NautilusSearchEngine still holds a reference to it. This causes a crash when trying to stop the already destroyed recent engine. Restore reference count increase to fix this. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/692 (cherry picked from commit 3eecada7ad7db8d66be24cfc4ba6677e33c7d6e1)
-rw-r--r--src/nautilus-search-engine-recent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c
index 8cc7b88f0..d265c1716 100644
--- a/src/nautilus-search-engine-recent.c
+++ b/src/nautilus-search-engine-recent.c
@@ -339,7 +339,7 @@ nautilus_search_engine_recent_start (NautilusSearchProvider *provider)
nautilus_query_get_recursive (self->query),
location))
{
- search_add_hits_idle (self, NULL);
+ search_add_hits_idle (g_object_ref (self), NULL);
return;
}