summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2012-09-07 09:44:40 +0200
committerMurray Cumming <murrayc@murrayc.com>2012-09-07 09:46:45 +0200
commit53eb53872cacc7f8f007ffa4e958b0a640cd92af (patch)
tree81220552b6c4d013c93e5a1ad52704d5fe3866f5
parentc34ee9bb7b7737e5cef9bf4775348aa10cf8410d (diff)
downloadglibmm-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--ChangeLog6
-rw-r--r--gio/giomm/contenttype.cc7
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 26eafc2b..e8482ad2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)