[nautilus] search-engine: hold a ref while emitting completion signals
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-engine: hold a ref while emitting completion signals
- Date: Thu, 6 Sep 2012 14:07:02 +0000 (UTC)
commit dc626a653496c397b325c06a9358b847cfef56d6
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Sep 6 10:03:36 2012 -0400
search-engine: hold a ref while emitting completion signals
Since the clients might decide to drop the last reference to the engine
in the signal callback.
libnautilus-private/nautilus-search-engine.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-engine.c b/libnautilus-private/nautilus-search-engine.c
index a3a0184..fc84729 100644
--- a/libnautilus-private/nautilus-search-engine.c
+++ b/libnautilus-private/nautilus-search-engine.c
@@ -151,9 +151,11 @@ search_provider_error (NautilusSearchProvider *provider,
DEBUG ("Search provider error: %s", error_message);
engine->details->providers_error++;
if (engine->details->providers_error == engine->details->num_providers) {
+ g_object_ref (engine);
nautilus_search_provider_error (NAUTILUS_SEARCH_PROVIDER (engine),
_("Unable to complete the requested search"));
g_hash_table_remove_all (engine->details->uris);
+ g_object_unref (engine);
}
}
@@ -164,8 +166,10 @@ search_provider_finished (NautilusSearchProvider *provider,
{
engine->details->providers_finished++;
if (engine->details->providers_finished == engine->details->num_providers) {
+ g_object_ref (engine);
nautilus_search_provider_finished (NAUTILUS_SEARCH_PROVIDER (engine));
g_hash_table_remove_all (engine->details->uris);
+ g_object_unref (engine);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]