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



commit 23442c271b882b44682b9a608552ebabdb2dafb4
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 |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-search-command.c b/plugins/symbol-db/symbol-db-search-command.c
index 3c4e774..f3e1640 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,
@@ -136,7 +142,7 @@ sdb_search_command_run (AnjutaCommand *command)
 
 	priv = sdbsc->priv;
 
-	DEBUG_PRINT ("Searching async");
+	DEBUG_PRINT ("Searching async with type %d", priv->cmd_search_type);
 	
 	switch (priv->cmd_search_type)
 	{
@@ -203,7 +209,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]