[glib] gvalue: Use g_value_clear as clear function



commit 3bb2e8dfc9eae7c6abd8fbec5fa751ffcb495121
Author: Nicolas Dufresne <nicolas dufresne collabora com>
Date:   Mon Sep 28 19:44:44 2015 -0400

    gvalue: Use g_value_clear as clear function
    
    This change allow leaving a scope before g_value_init() has been
    called. This would happen if you do:
    
      {
        g_auto(GValue) value = G_VALUE_INIT;
      }
    
    Or have a return statement (due to failure) before the part of
    your code where you set this GValue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755766

 gobject/gobject-autocleanups.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gobject-autocleanups.h b/gobject/gobject-autocleanups.h
index 980203f..6f25338 100644
--- a/gobject/gobject-autocleanups.h
+++ b/gobject/gobject-autocleanups.h
@@ -23,4 +23,4 @@
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
-G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_clear)


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