[libgda] gda-data-model-dsn-list: Fix segfault



commit b2b2b5cdcab70c1b03fe153cc7ff30416046a8c1
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Sep 21 17:25:20 2018 -0500

    gda-data-model-dsn-list: Fix segfault

 libgda/gda-data-model-dsn-list.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/libgda/gda-data-model-dsn-list.c b/libgda/gda-data-model-dsn-list.c
index 0db5c4f7f..1b17bea8b 100644
--- a/libgda/gda-data-model-dsn-list.c
+++ b/libgda/gda-data-model-dsn-list.c
@@ -36,11 +36,10 @@ typedef struct {
 
 static void                 gda_data_model_dsn_list_data_model_init (GdaDataModelIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GdaDataModelDsnList,gda_data_model_dsn_list,G_TYPE_OBJECT,
+G_DEFINE_TYPE_WITH_CODE (GdaDataModelDsnList, gda_data_model_dsn_list,G_TYPE_OBJECT,
+                         G_ADD_PRIVATE (GdaDataModelDsnList)
                          G_IMPLEMENT_INTERFACE(GDA_TYPE_DATA_MODEL,gda_data_model_dsn_list_data_model_init))
 
-static void gda_data_model_dsn_list_class_init (GdaDataModelDsnListClass *klass);
-static void gda_data_model_dsn_list_init       (GdaDataModelDsnList *model);
 static void gda_data_model_dsn_list_dispose    (GObject *object);
 
 /* GdaDataModel interface */
@@ -89,8 +88,7 @@ gda_data_model_dsn_list_init (GdaDataModelDsnList *model)
 {
        GdaConfig *config;
        GdaColumn *col;
-       GdaDataModelDsnList *dmodel = GDA_DATA_MODEL_DSN_LIST (model);
-       GdaDataModelDsnListPrivate *priv = gda_data_model_dsn_list_get_instance_private (dmodel);
+       GdaDataModelDsnListPrivate *priv = gda_data_model_dsn_list_get_instance_private (model);
 
        priv->nb_dsn = gda_config_get_nb_dsn ();
        priv->row_to_remove = -1;


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