From 130190ed1ca0387b4bc22b15b0e1a910e961c667 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 29 Feb 2016 00:27:59 +0000 Subject: 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. --- json-glib/json-generator.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'json-glib/json-generator.h') 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__ */ -- cgit v1.2.1