[glade/gbinding: 3/60] Fix memory leaks
- From: Denis Washington <denisw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/gbinding: 3/60] Fix memory leaks
- Date: Tue, 13 Dec 2011 06:59:43 +0000 (UTC)
commit 02c86da7fa2975e52a32307aeffa234fe01740b4
Author: Denis Washington <denisw src gnome org>
Date: Sat Jun 4 21:11:46 2011 +0200
Fix memory leaks
gladeui/glade-binding.c | 14 ++++++++++++++
gladeui/glade-property.c | 2 ++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gladeui/glade-binding.c b/gladeui/glade-binding.c
index 9e2718d..97e9f08 100644
--- a/gladeui/glade-binding.c
+++ b/gladeui/glade-binding.c
@@ -81,6 +81,13 @@ glade_binding_init (GladeBinding *binding)
static void
glade_binding_finalize (GObject *object)
{
+ GladeBindingPrivate *priv = GLADE_BINDING_GET_PRIVATE (GLADE_BINDING (object));
+
+ if (priv->source_object_name)
+ g_free (priv->source_object_name);
+
+ if (priv->source_property_name)
+ g_free (priv->source_property_name);
}
static void
@@ -259,6 +266,8 @@ glade_binding_read (GladeXmlNode *node,
priv->source_object_name = source;
priv->source_property_name = from;
+ g_free (to);
+
return binding;
}
@@ -302,6 +311,11 @@ glade_binding_complete (GladeBinding *binding,
if (source)
priv->source = source;
}
+
+ g_free (source_obj);
+ g_free (source_prop);
+ priv->source_object_name = NULL;
+ priv->source_property_name = NULL;
}
/**
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 877e26d..49e2b2e 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -580,6 +580,8 @@ glade_property_finalize (GObject * object)
g_value_unset (property->priv->value);
g_free (property->priv->value);
}
+ if (property->priv->binding)
+ g_object_unref (property->priv->binding);
if (property->priv->i18n_comment)
g_free (property->priv->i18n_comment);
if (property->priv->i18n_context)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]