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
This commit is contained in:
Nicolas Dufresne 2015-09-28 19:44:44 -04:00 committed by Nicolas Dufresne
parent 1233962b54
commit 3bb2e8dfc9

View File

@ -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)