summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kolny <marcin.kolny@gmail.com>2015-08-07 10:25:50 +0000
committerMarcin Kolny <marcin.kolny@gmail.com>2015-08-07 10:25:52 +0000
commitd94115843f38967b5e883f5f7d8057882ae364cb (patch)
tree30b7a78eb609e007c4af7b953ca5e724bc814e59
parentb8ec08faa271e90b4cce00e0fe9046ede36bb997 (diff)
downloadglibmm-d94115843f38967b5e883f5f7d8057882ae364cb.tar.gz
Glib::RefPtr: minor release() improvements.
https://bugzilla.gnome.org/show_bug.cgi?id=752812 * glib/glibmm/refptr.h: add warning in a comment, replace warn_unused_result attribute with corresponding GLib macro.
-rw-r--r--glib/glibmm/refptr.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h
index 5e213849..30dbf185 100644
--- a/glib/glibmm/refptr.h
+++ b/glib/glibmm/refptr.h
@@ -20,6 +20,7 @@
*/
#include <glibmmconfig.h>
+#include <glib.h>
#include <utility>
namespace Glib
@@ -146,8 +147,12 @@ public:
*
* RefPtr's underlying instance is set to nullptr, therefore underlying object can't be accessed through this RefPtr anymore.
* @return an underlying instance.
+ *
+ * Most users should not use release(). It can spoil the automatic destruction
+ * of the managed object. A legitimate use is if you immediately give RefPtr's
+ * reference to another object.
*/
- inline T_CppObject* release() __attribute__((warn_unused_result));
+ inline T_CppObject* release() G_GNUC_WARN_UNUSED_RESULT;
/** Dynamic cast to derived class.
*