Comment 8 for bug 1804260

Revision history for this message
Julian Andres Klode (juliank) wrote :

The bug seems to be wrong reference counting of the NautilusSearchEngineRecent, and both search_thread_add_hits_idle and recent_thread_func have been changed in the last upload to have code that looks like this:

search_thread_add_hits_idle:
g_autoptr (NautilusSearchEngineRecent) self = search_hits->recent;

recent_thread_func:
g_autoptr (NautilusSearchEngineRecent) self = NAUTILUS_SEARCH_ENGINE_RECENT (user_data);

however, recent_thread_func (unlike search_thread_add_hits_idle) did not lose the g_object_unref (self); at the end so it decrements once more than it did before.

I do think search_thread_add_hits_idle is wrong as well, and needs to be
  g_autoptr (NautilusSearchEngineRecent) self = g_object_ref(search_hits->recent);
or just
  NautilusSearchEngineRecent *self = search_hits->recent;

as you are just providing an alias to that field, so why are you decrementing it once every time you call this function?