Hey Dodji, Yes, ofcourse it is better to put them in nmv-safe-ptr-utils.h.
diff --git a/src/common/nmv-safe-ptr-utils.h b/src/common/nmv-safe-ptr-utils.h
index 27b0f85..fdeb350 100644
--- a/src/common/nmv-safe-ptr-utils.h
+++ b/src/common/nmv-safe-ptr-utils.h
@@ -99,13 +99,29 @@ struct DelUnicharsUnref {
}
};
+struct GErrorRef {
+ void
+ operator () (GError *)
+ {}
+};
+
+struct GErrorUnref {
+ void
+ operator () (GError *a_error)
+ {
+ if (a_error) {
+ g_error_free (a_error);
+ }
+ }
+};
+
typedef SafePtr <gchar, CharsRef, GCharUnref> GCharSafePtr;
typedef SafePtr <Object, ObjectRef, ObjectUnref> ObjectSafePtr;
typedef SafePtr <gchar, CharsRef, DelCharsUnref> CharSafePtr;
typedef SafePtr <gunichar, UnicharsRef, DelUnicharsUnref> UnicharSafePtr;
+typedef SafePtr<GError, GErrorRef, GErrorUnref> GErrorSafePtr;
Maybe a space between SafePtr and <? Happy hacking, Debarshi -- It has its possibilities but I am bound by my limitations. -- Vivek Shah
Attachment:
pgpVBW6SRGUk9.pgp
Description: PGP signature