diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-01-20 14:29:30 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-01-20 14:29:30 +0100 |
commit | f98e006e6fa694003d4cba1d76660f9a5afa8597 (patch) | |
tree | 2a59f7dc09b3c2346a7a9406a9c7594eb0db323b | |
parent | 73c7b106296c78962077a8bfddbe1b0ff4094533 (diff) | |
download | glibmm-2-24.tar.gz |
Resolver: lookup_service(), lookup_by_address(): Fix the reference counting.glibmm-2-24
* gio/src/resolver.[hg|ccg]: Use the correct OWNERSHIP_*, based on the
documentation for the C functions. We must release both the list and the
items.
Bug #639575 (Michael Edwards).
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gio/src/resolver.ccg | 4 | ||||
-rw-r--r-- | gio/src/resolver.hg | 5 |
3 files changed, 13 insertions, 5 deletions
@@ -1,3 +1,12 @@ +2011-01-20 Murray Cumming <murrayc@murrayc.com> + + Resolver: lookup_service(), lookup_by_address(): Fix the reference counting. + + * gio/src/resolver.[hg|ccg]: Use the correct OWNERSHIP_*, based on the + documentation for the C functions. We must release both the list and the + items. + Bug #639575 (Michael Edwards). + 2010-09-28 Armin Burgmeier <armin@arbur.net> * MSVC_Net2005/examples/compose/compose.vcproj: diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg index e7be91b8..db85fb4d 100644 --- a/gio/src/resolver.ccg +++ b/gio/src/resolver.ccg @@ -40,7 +40,7 @@ Glib::ListHandle< Glib::RefPtr<InetAddress> > Resolver::lookup_by_name(const Gli #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; - Glib::ListHandle< Glib::RefPtr<InetAddress> > retvalue = Glib::ListHandle< Glib::RefPtr<InetAddress> >(g_resolver_lookup_by_name(gobj(), hostname.c_str(), 0, &(gerror)), Glib::OWNERSHIP_SHALLOW); + Glib::ListHandle< Glib::RefPtr<InetAddress> > retvalue = Glib::ListHandle< Glib::RefPtr<InetAddress> >(g_resolver_lookup_by_name(gobj(), hostname.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); @@ -80,7 +80,7 @@ ListHandle_SrvTarget Resolver::lookup_service(const Glib::ustring& service, cons #endif //GLIBMM_EXCEPTIONS_ENABLED { GError* gerror = 0; - ListHandle_SrvTarget retvalue = ListHandle_SrvTarget(g_resolver_lookup_service(gobj(), service.c_str(), protocol.c_str(), domain.c_str(), 0, &(gerror)), Glib::OWNERSHIP_SHALLOW); + ListHandle_SrvTarget retvalue = ListHandle_SrvTarget(g_resolver_lookup_service(gobj(), service.c_str(), protocol.c_str(), domain.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP); #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/resolver.hg b/gio/src/resolver.hg index 245c6dfb..dcee7f34 100644 --- a/gio/src/resolver.hg +++ b/gio/src/resolver.hg @@ -58,7 +58,7 @@ public: // g_resolver_free_addresses is just a C convenience function _IGNORE(g_resolver_free_addresses) -#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<InetAddress> >',`$2($3, Glib::OWNERSHIP_SHALLOW)') +#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<InetAddress> >',`$2($3, Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<InetAddress> > lookup_by_name(const Glib::ustring& hostname, const Glib::RefPtr<Cancellable>& cancellable), g_resolver_lookup_by_name, errthrow) #ifdef GLIBMM_EXCEPTIONS_ENABLED Glib::ListHandle< Glib::RefPtr<InetAddress> > lookup_by_name(const Glib::ustring& hostname); @@ -70,7 +70,6 @@ public: _IGNORE(g_resolver_lookup_by_name_async) _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<InetAddress> > lookup_by_name_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_by_name_finish, errthrow) -#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<InetAddress> >',`$2($3, Glib::OWNERSHIP_SHALLOW)') _WRAP_METHOD(Glib::ustring lookup_by_address(const Glib::RefPtr<InetAddress>& address, const Glib::RefPtr<Cancellable>& cancellable), g_resolver_lookup_by_address, errthrow) #ifdef GLIBMM_EXCEPTIONS_ENABLED Glib::ustring lookup_by_address(const Glib::RefPtr<InetAddress>& address); @@ -82,7 +81,7 @@ public: _IGNORE(g_resolver_lookup_by_address_async) _WRAP_METHOD(Glib::ustring lookup_by_address_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_by_address_finish, errthrow) -#m4 _CONVERSION(`GList*',`ListHandle_SrvTarget',`$2($3, Glib::OWNERSHIP_SHALLOW)') +#m4 _CONVERSION(`GList*',`ListHandle_SrvTarget',`$2($3, Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(ListHandle_SrvTarget lookup_service(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain, const Glib::RefPtr<Cancellable>& cancellable), g_resolver_lookup_service, errthrow) #ifdef GLIBMM_EXCEPTIONS_ENABLED ListHandle_SrvTarget lookup_service(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain); |