[anjuta/cxxparser] symbol-db: fix #597113



commit cf37ddba1ad2d68e563be2fb3d80305e6d47eb95
Author: Massimo Corà <mcora src gnome org>
Date:   Tue Oct 6 19:04:06 2009 +0200

    symbol-db: fix #597113
    
    The crash was probably due to #588485. Improved code.

 plugins/symbol-db/symbol-db-engine-core.c |  157 +++++++++++++++--------------
 1 files changed, 81 insertions(+), 76 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-core.c b/plugins/symbol-db/symbol-db-engine-core.c
index e249882..826e8c1 100644
--- a/plugins/symbol-db/symbol-db-engine-core.c
+++ b/plugins/symbol-db/symbol-db-engine-core.c
@@ -767,15 +767,16 @@ sdb_engine_get_tuple_id_by_unique_name (SymbolDBEngine * dbe, static_query_type
 	}
 
 	ret_value = gda_holder_take_static_value (param, param_value, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_STR(priv, ret_value);		
-	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{		
+			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}
 	}	
 	
 	/* execute the query with parametes just set */
@@ -847,16 +848,17 @@ sdb_engine_get_tuple_id_by_unique_name2 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value1, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}	
 		
 	
 	/* ...and the second one */
@@ -869,16 +871,17 @@ sdb_engine_get_tuple_id_by_unique_name2 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value2, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}	
 
 	/* execute the query with parametes just set */
 	data_model = gda_connection_statement_execute_select (priv->db_connection, 
@@ -942,16 +945,17 @@ sdb_engine_get_tuple_id_by_unique_name3 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value1, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}		
 
 	
 	/* ...and the second one */
@@ -964,16 +968,17 @@ sdb_engine_get_tuple_id_by_unique_name3 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value2, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}	
 
 
 	/* ...and the third one */
@@ -986,16 +991,17 @@ sdb_engine_get_tuple_id_by_unique_name3 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value3, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}	
 
 		
 	/* execute the query with parametes just set */
@@ -1061,18 +1067,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value1, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}		
-
-	
 
 	/* ...and the second one */
 	if ((param = gda_set_get_holder ((GdaSet*)plist, param_key2)) == NULL)
@@ -1083,17 +1088,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value2, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}		
-
 
 	/* ...and the third one */
 	if ((param = gda_set_get_holder ((GdaSet*)plist, param_key3)) == NULL)
@@ -1104,17 +1109,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
 	}
 	
 	ret_value = gda_holder_take_static_value (param, value3, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}		
-
 		
 	/* ...and the fourth one */
 	if ((param = gda_set_get_holder ((GdaSet*)plist, param_key4)) == NULL)
@@ -1125,17 +1130,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
 	}
 
 	ret_value = gda_holder_take_static_value (param, value4, &ret_bool, NULL);	
-	if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+	if (ret_value != NULL)
 	{
-		if (ret_value != NULL)
+		if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+		{
 			MP_RETURN_OBJ_STR(priv, ret_value);
+		}
+		else
+		{
+			MP_RETURN_OBJ_INT(priv, ret_value);
+		}	
 	}
-	else
-	{
-		if (ret_value != NULL)
-			MP_RETURN_OBJ_INT(priv, ret_value);		
-	}		
-	
 			
 	/* execute the query with parametes just set */
 	data_model = gda_connection_statement_execute_select (priv->db_connection, 



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