diff options
author | Murray Cumming <murrayc@murrayc.com> | 2012-09-07 09:44:40 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2012-09-07 09:46:45 +0200 |
commit | 53eb53872cacc7f8f007ffa4e958b0a640cd92af (patch) | |
tree | 81220552b6c4d013c93e5a1ad52704d5fe3866f5 | |
parent | c34ee9bb7b7737e5cef9bf4775348aa10cf8410d (diff) | |
download | glibmm-2-32.tar.gz |
ContentType: get_icon(): Fix a refcount error.glibmm-2-32
* gio/giomm/contenttype.cc: get_icon(): Take a reference.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gio/giomm/contenttype.cc | 7 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2012-09-07 Murray Cumming <murrayc@murrayc.com> + + ContentType: get_icon(): Fix a refcount error. + + * gio/giomm/contenttype.cc: get_icon(): Take a reference. + 2.32.1: 2012-07-10 Krzesimir Nowak <qdlacz@gmail.com> diff --git a/gio/giomm/contenttype.cc b/gio/giomm/contenttype.cc index c0c3a499..f46534b9 100644 --- a/gio/giomm/contenttype.cc +++ b/gio/giomm/contenttype.cc @@ -50,9 +50,10 @@ Glib::ustring content_type_get_mime_type(const Glib::ustring& type) Glib::RefPtr<Gio::Icon> content_type_get_icon(const Glib::ustring& type) { - //TODO: Does g_content_type_get_icon() return a reference? - //It currently has no implementation so it's hard to know. murrayc. - return Glib::wrap(g_content_type_get_icon(type.c_str())); + Glib::RefPtr<Icon> retvalue = Glib::wrap(g_content_type_get_icon(type.c_str())); + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; } bool content_type_can_be_executable(const Glib::ustring& type) |