[glade/gbinding: 19/60] Take advantage of the fact that g_free (NULL) safely does nothing
- From: Denis Washington <denisw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/gbinding: 19/60] Take advantage of the fact that g_free (NULL) safely does nothing
- Date: Tue, 13 Dec 2011 07:01:04 +0000 (UTC)
commit 8a28e6887e77f6e59ed705fb040f96e5b4f5328c
Author: Denis Washington <denisw src gnome org>
Date: Fri Jun 10 14:33:12 2011 +0200
Take advantage of the fact that g_free (NULL) safely does nothing
I didn't know this before to be honest. Again, thanks Juan!
gladeui/glade-binding.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gladeui/glade-binding.c b/gladeui/glade-binding.c
index 1c2b691..2f4fb16 100644
--- a/gladeui/glade-binding.c
+++ b/gladeui/glade-binding.c
@@ -88,11 +88,8 @@ 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);
+ g_free (priv->source_object_name);
+ g_free (priv->source_property_name);
}
static void
@@ -288,12 +285,9 @@ glade_binding_read (GladeXmlNode *node,
if (!to || !from || !source)
{
- if (to)
- g_free (to);
- if (from)
- g_free (from);
- if (source)
- g_free (source);
+ g_free (to);
+ g_free (from);
+ g_free (source);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]