[libgda: 1/2] libgda: Removed global static variable
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda: 1/2] libgda: Removed global static variable
- Date: Tue, 12 Nov 2019 23:31:32 +0000 (UTC)
commit e6bdccd40bf8b1fd086db137db5c75f96036376b
Author: Pavlo Solntsev <p sun fun gmail com>
Date: Mon Nov 4 14:23:56 2019 -0600
libgda: Removed global static variable
libgda/gda-data-pivot.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/libgda/gda-data-pivot.c b/libgda/gda-data-pivot.c
index 4f9c29ace..1df9b74fe 100644
--- a/libgda/gda-data-pivot.c
+++ b/libgda/gda-data-pivot.c
@@ -98,10 +98,6 @@ static GdaColumn *gda_data_pivot_describe_column (GdaDataModel *model,
static GdaDataModelAccessFlags gda_data_pivot_get_access_flags(GdaDataModel *model);
static const GValue *gda_data_pivot_get_value_at (GdaDataModel *model, gint col, gint row, GError
**error);
-static GMutex provider_mutex;
-static GdaVirtualProvider *virtual_provider = NULL;
-
-
typedef struct {
GdaDataModel *model; /* data to analyse */
@@ -2049,13 +2045,15 @@ create_vcnc (GdaDataPivot *pivot, GError **error)
{
GdaConnection *vcnc;
GError *lerror = NULL;
- GdaDataPivotPrivate *priv = gda_data_pivot_get_instance_private (pivot);
- if (priv->vcnc)
- return TRUE;
-
- g_mutex_lock (&provider_mutex);
- if (!virtual_provider)
- virtual_provider = gda_vprovider_data_model_new ();
+ static GMutex provider_mutex;
+ static GdaVirtualProvider *virtual_provider;
+ GdaDataPivotPrivate * priv = gda_data_pivot_get_instance_private (pivot);
+ if (priv->vcnc)
+ return TRUE;
+
+ g_mutex_lock (&provider_mutex);
+ if (!virtual_provider)
+ virtual_provider = gda_vprovider_data_model_new ();
g_mutex_unlock (&provider_mutex);
vcnc = gda_virtual_connection_open (virtual_provider, GDA_CONNECTION_OPTIONS_NONE, &lerror);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]