summaryrefslogtreecommitdiff
path: root/json-glib/json-generator.h
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2016-02-29 00:27:59 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2016-02-29 00:27:59 +0000
commit130190ed1ca0387b4bc22b15b0e1a910e961c667 (patch)
treed7b9661ae93f675383ffa2e617e96fd065cc5871 /json-glib/json-generator.h
parenta1490d9b6a3a21774d68f085f805d5f7a68b305e (diff)
downloadjson-glib-130190ed1ca0387b4bc22b15b0e1a910e961c667.tar.gz
Add autoptr macros
GLib can take advantage of the "cleanup" attribute by using a bunch of macro magic. This has been slowly been used across various libraries in the G* stack, so JSON-GLib should provide symbols for the automatic memory management of its types.
Diffstat (limited to 'json-glib/json-generator.h')
-rw-r--r--json-glib/json-generator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/json-glib/json-generator.h b/json-glib/json-generator.h
index 99c1b1d..194495a 100644
--- a/json-glib/json-generator.h
+++ b/json-glib/json-generator.h
@@ -115,6 +115,10 @@ gboolean json_generator_to_stream (JsonGenerator *generator,
GCancellable *cancellable,
GError **error);
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (JsonGenerator, g_object_unref)
+#endif
+
G_END_DECLS
#endif /* __JSON_GENERATOR_H__ */