[anjuta/gnome-2-28] symbol-db: pattern on search-async was not preserved with g_strdup ().



commit f978aa87adb18bffad5938818f186f4aeed91a13
Author: Massimo Corà <mcora src gnome org>
Date:   Sun Nov 22 21:47:46 2009 +0100

    symbol-db: pattern on search-async was not preserved with g_strdup ().

 plugins/symbol-db/symbol-db-search-command.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-search-command.c b/plugins/symbol-db/symbol-db-search-command.c
index 102e860..0f4f472 100644
--- a/plugins/symbol-db/symbol-db-search-command.c
+++ b/plugins/symbol-db/symbol-db-search-command.c
@@ -57,13 +57,20 @@ sdb_search_command_init (SymbolDBSearchCommand *object)
 
 	object->priv->gfile = NULL;
 	object->priv->session_packages = NULL;
+	object->priv->pattern = NULL;
 }
 
 static void
 sdb_search_command_finalize (GObject *object)
 {
 	SymbolDBSearchCommand *sdbsc;	
+	SymbolDBSearchCommandPriv *priv;
 	sdbsc = SYMBOL_DB_SEARCH_COMMAND (object);
+
+	priv = sdbsc->priv;
+	
+	g_free (priv->pattern);	
+	priv->pattern = NULL;
 	
 	g_free (sdbsc->priv);
 	
@@ -108,7 +115,6 @@ do_search_prj_glb (SymbolDBSearchCommand *sdbsc)
 	SymbolDBSearchCommandPriv *priv;	
 
 	priv = sdbsc->priv;
-
 	iterator = 		
 		symbol_db_engine_find_symbol_by_name_pattern_filtered (priv->dbe,
 					priv->pattern,
@@ -192,7 +198,7 @@ symbol_db_search_command_new (SymbolDBEngine *dbe, CmdSearchType cmd_search_type
 	priv->match_types = match_types;
 	priv->include_types = include_types;
 	priv->info_fields = info_fields;
-	priv->pattern = pattern;
+	priv->pattern = g_strdup (pattern);
 	priv->filescope_search = filescope_search;
 	priv->results_limit = results_limit;
 	priv->results_offset = results_offset;	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]