[libgda] DB: Adding checker to the property "table"
- From: Pavlo Solntsev <psolntsev src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] DB: Adding checker to the property "table"
- Date: Sun, 12 Jul 2020 03:40:43 +0000 (UTC)
commit fc889d6d82285097b96cfe2f080cf36a600521b0
Author: Pavlo Solntsev <p sun fun gmail com>
Date: Wed Jun 3 14:40:17 2020 -0500
DB: Adding checker to the property "table"
libgda/gda-db-column.c | 9 +++++----
libgda/gda-db-index.c | 4 ++--
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/libgda/gda-db-column.c b/libgda/gda-db-column.c
index 758bf53dd..63b3c0020 100644
--- a/libgda/gda-db-column.c
+++ b/libgda/gda-db-column.c
@@ -188,7 +188,7 @@ gda_db_column_dispose (GObject *object)
GdaDbColumn *self = GDA_DB_COLUMN (object);
GdaDbColumnPrivate *priv = gda_db_column_get_instance_private (self);
- g_object_unref (priv->mp_table);
+ if (priv->mp_table) g_object_unref (priv->mp_table);
G_OBJECT_CLASS (gda_db_column_parent_class)->dispose (object);
}
@@ -287,8 +287,9 @@ gda_db_column_set_property (GObject *object,
priv->m_scale = g_value_get_uint (value);
break;
case PROP_COLUMN_TABLE:
- g_object_unref (priv->mp_table);
- priv->mp_table = g_value_get_object (value);
+ if (priv->mp_table)
+ g_object_unref (priv->mp_table);
+ priv->mp_table = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1320,7 +1321,7 @@ gda_db_column_create (GdaDdlModifiable *self,
GdaDbTable *table = NULL;
GdaDbColumn *column = GDA_DB_COLUMN (self);
- const gchar *strtype;
+ const gchar *strtype = NULL;
if (!gda_connection_is_opened (cnc))
{
diff --git a/libgda/gda-db-index.c b/libgda/gda-db-index.c
index 229e38b4d..c20381368 100644
--- a/libgda/gda-db-index.c
+++ b/libgda/gda-db-index.c
@@ -129,7 +129,7 @@ gda_db_index_dispose (GObject *object)
GdaDbIndex *self = GDA_DB_INDEX (object);
GdaDbIndexPrivate *priv = gda_db_index_get_instance_private (self);
- g_object_unref (priv->mTable);
+ if (priv->mTable) g_object_unref (priv->mTable);
G_OBJECT_CLASS (gda_db_index_parent_class)->dispose (object);
}
@@ -507,7 +507,7 @@ gda_db_index_create (GdaDdlModifiable *self,
on_error:
if (op) g_object_unref (op);
- g_object_unref (table);
+ if (table) g_object_unref (table);
gda_lockable_unlock (GDA_LOCKABLE (cnc));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]