summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-10-19 21:03:43 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-10-19 21:03:43 -0400
commit269acbe7032cbc02b0c0edead054824ba111a5f1 (patch)
treea84c298cc4f51297090bd1e84e1d3f96a2eded3d
parent3569af4af10b2ae65d4d93bfb3de929e1d1e2308 (diff)
Deprecate g_atexit
This function was just not a good idea to begin with. Its documentation gives plenty of reason not to use it.
-rw-r--r--glib/gutils.c3
-rw-r--r--glib/gutils.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/glib/gutils.c b/glib/gutils.c
index 934452d2b..4b77dbcf3 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -251,6 +251,9 @@ g_memmove (gpointer dest,
* As can be seen from the above, for portability it's best to avoid
* calling g_atexit() (or atexit()) except in the main executable of a
* program.
+ *
+ * Deprecated:2.32: It is best to avoid g_atexit(), for the reasons
+ * outlined above.
*/
void
g_atexit (GVoidFunc func)
diff --git a/glib/gutils.h b/glib/gutils.h
index b1c1460a0..b3657011d 100644
--- a/glib/gutils.h
+++ b/glib/gutils.h
@@ -214,7 +214,6 @@ gchar *g_format_size (guint64 size);
#ifndef G_DISABLE_DEPRECATED
GLIB_DEPRECATED_FOR(g_format_size)
gchar *g_format_size_for_display (goffset size);
-#endif
/**
* GVoidFunc:
@@ -234,6 +233,7 @@ typedef void (*GVoidFunc) (void);
* (if there is any in the implementation) and doesn't encounter
* missing include files.
*/
+GLIB_DEPRECATED
void g_atexit (GVoidFunc func);
#ifdef G_OS_WIN32
@@ -249,6 +249,8 @@ int atexit (void (*)(void));
#define g_atexit(func) atexit(func)
#endif
+#endif /* G_DISABLE_DEPRECATED */
+
#ifndef __GTK_DOC_IGNORE__
#ifdef G_OS_WIN32
#define g_find_program_in_path g_find_program_in_path_utf8