[anjuta] symbol-db: Remove possible race condition in unref of notify as well.
- From: Naba Kumar <naba src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] symbol-db: Remove possible race condition in unref of notify as well.
- Date: Sun, 21 Feb 2010 00:31:17 +0000 (UTC)
commit e2a2206e4c8e692a8fb5aa81165e3fbf713fe8aa
Author: Naba Kumar <naba gnome org>
Date: Sun Feb 21 02:30:31 2010 +0200
symbol-db: Remove possible race condition in unref of notify as well.
plugins/symbol-db/symbol-db-iface.c | 30 ++++++++----------------------
1 files changed, 8 insertions(+), 22 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-iface.c b/plugins/symbol-db/symbol-db-iface.c
index 0be9515..3dc7dea 100644
--- a/plugins/symbol-db/symbol-db-iface.c
+++ b/plugins/symbol-db/symbol-db-iface.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* anjuta
* Copyright (C) Massimo Cora' 2007-2009 <maxcvs email it>
@@ -366,11 +367,12 @@ on_sdb_search_command_data_arrived (AnjutaCommand *command,
static void
on_sdb_search_command_finished (SymbolDBSearchCommand *search_command,
- guint return_code,
+ guint return_code,
AnjutaAsyncNotify *notify)
{
- if (!symbol_db_search_command_get_cancelled (search_command))
+ if (!symbol_db_search_command_get_cancelled (search_command) && notify)
anjuta_async_notify_notify_finished (notify);
+ g_object_unref (search_command); /* Fully done */
}
static void
@@ -414,9 +416,8 @@ do_search_prj_glb_async (SymbolDBSearchCommand *search_command, guint cmd_id,
callback);
g_signal_connect (G_OBJECT (search_command), "command-finished",
- G_CALLBACK (g_object_unref),
- NULL);
-
+ G_CALLBACK (on_sdb_search_command_finished),
+ notify);
if (cancel)
{
g_object_ref (cancel);
@@ -425,13 +426,6 @@ do_search_prj_glb_async (SymbolDBSearchCommand *search_command, guint cmd_id,
search_command);
}
- if (notify)
- {
- g_signal_connect (G_OBJECT (search_command), "command-finished",
- G_CALLBACK (on_sdb_search_command_finished),
- notify);
- }
-
anjuta_command_start (ANJUTA_COMMAND (search_command));
return cmd_id;
@@ -627,9 +621,8 @@ isymbol_manager_search_file_async (IAnjutaSymbolManager *sm, IAnjutaSymbolType m
callback);
g_signal_connect (G_OBJECT (search_command), "command-finished",
- G_CALLBACK (g_object_unref),
- NULL);
-
+ G_CALLBACK (on_sdb_search_command_finished),
+ notify);
if (cancel)
{
g_object_ref (cancel);
@@ -638,13 +631,6 @@ isymbol_manager_search_file_async (IAnjutaSymbolManager *sm, IAnjutaSymbolType m
search_command);
}
- if (notify)
- {
- g_signal_connect (G_OBJECT (search_command), "command-finished",
- G_CALLBACK (on_sdb_search_command_finished),
- notify);
- }
-
anjuta_command_start (ANJUTA_COMMAND (search_command));
return cmd_id;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]