[glibmm] Glib::OptionGroup: Don't use the deprecated g_option_group_free()



commit e8ebd092607811714b904ca0a6b1781c1ec502a2
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Feb 17 12:42:47 2015 +0100

    Glib::OptionGroup: Don't use the deprecated g_option_group_free()
    
    * glib/src/optiongroup.ccg: Replace the deprecated g_option_group_free() by
    g_option_group_unref().
    * glib/src/optiongroup.hg: Add a TODO comment.

 glib/src/optiongroup.ccg |    2 +-
 glib/src/optiongroup.hg  |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg
index 4a87564..3ddc165 100644
--- a/glib/src/optiongroup.ccg
+++ b/glib/src/optiongroup.ccg
@@ -294,7 +294,7 @@ OptionGroup::~OptionGroup()
 
   if(has_ownership_)
   {
-    g_option_group_free(gobj());
+    g_option_group_unref(gobj());
     gobject_ = 0;
   }
 }
diff --git a/glib/src/optiongroup.hg b/glib/src/optiongroup.hg
index 9857208..4afe9c1 100644
--- a/glib/src/optiongroup.hg
+++ b/glib/src/optiongroup.hg
@@ -37,6 +37,8 @@ class OptionEntry;
 class OptionContext;
 #endif //DOXYGEN_SHOULD_SKIP_THIS
 
+//TODO: GOptionGroup is now refcounted. See https://bugzilla.gnome.org/show_bug.cgi?id=743349
+//When we can break API/ABI, make Glib::OptionGroup refcounted. _CLASS_OPAQUE_REFCOUNTED?
 /** An OptionGroup defines the options in a single group.
  * Libraries which need to parse commandline options are expected to provide a function that allows their 
OptionGroups to
  * be added to the application's OptionContext.
@@ -65,10 +67,10 @@ public:
    * so it is only useful with C functions that return newly-allocated GOptionGroups.
    */
   explicit OptionGroup(GOptionGroup* castitem);
-  _IGNORE(g_option_group_new)
+  _IGNORE(g_option_group_new, g_option_group_ref)
 
   virtual ~OptionGroup();
-  _IGNORE(g_option_group_free)
+  _IGNORE(g_option_group_free, g_option_group_unref)
 
 
   virtual bool on_pre_parse(OptionContext& context, OptionGroup& group);


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