[libgda] GdaBrowser: locking correction



commit 74a7f3d79d3da3b9619b18f4c140d56ee9721681
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Sep 2 20:57:28 2010 +0200

    GdaBrowser: locking correction

 tools/browser/browser-connection.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/tools/browser/browser-connection.c b/tools/browser/browser-connection.c
index 4e77fdc..b04b735 100644
--- a/tools/browser/browser-connection.c
+++ b/tools/browser/browser-connection.c
@@ -309,17 +309,20 @@ wrapper_meta_struct_sync (BrowserConnection *bcnc, GError **error)
 	mstruct = (GdaMetaStruct *) bcnc->priv->p_mstruct_list->data;
 	bcnc->priv->p_mstruct_list = g_slist_delete_link (bcnc->priv->p_mstruct_list,
 							  bcnc->priv->p_mstruct_list);
-	if (bcnc->priv->p_mstruct_list)
+	if (bcnc->priv->p_mstruct_list) {
 		/* don't care about this one */
 		g_object_unref (G_OBJECT (mstruct));
+		g_mutex_unlock (bcnc->priv->p_mstruct_mutex);
+	}
 	else {
 		if (bcnc->priv->c_mstruct)
 			g_object_unref (bcnc->priv->c_mstruct);
 		bcnc->priv->c_mstruct = mstruct;
+		g_mutex_unlock (bcnc->priv->p_mstruct_mutex);
+
 		/*g_print ("Meta struct sync for %p\n", mstruct);*/
 		retval = gda_meta_struct_complement_all (mstruct, error);
 	}
-	g_mutex_unlock (bcnc->priv->p_mstruct_mutex);
 
 	return GINT_TO_POINTER (retval ? 2 : 1);
 }



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