summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-06-24 10:51:28 +0200
committerThomas Haller <thaller@redhat.com>2021-06-28 13:31:33 +0200
commit0389a4786c73a9ca112fe58a293777da2c0fbb94 (patch)
treecc98d3c27797d6cfe0038c71eae7756d9e36aeeb
parent752db4904d276fdefdac976cb9a838e0cd455703 (diff)
downloadNetworkManager-0389a4786c73a9ca112fe58a293777da2c0fbb94.tar.gz
glib-aux: prevent usage of g_source_remove*() API
Searching over all sources in order to remove them is not what we want to do. If you think you need these functions, instead keep track of the GSource instances yourself.
-rw-r--r--src/libnm-glib-aux/nm-glib.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libnm-glib-aux/nm-glib.h b/src/libnm-glib-aux/nm-glib.h
index cd75acd57a..0af9e21f29 100644
--- a/src/libnm-glib-aux/nm-glib.h
+++ b/src/libnm-glib-aux/nm-glib.h
@@ -684,11 +684,21 @@ g_hash_table_steal_extended(GHashTable * hash_table,
/*****************************************************************************/
-_nm_deprecated("Don't use g_cancellable_reset(). Create a new cancellable "
- "instead.") void _nm_g_cancellable_reset(GCancellable *cancellable);
+_nm_deprecated("Don't use this API") void _nm_forbidden_glib_api_0(void);
+_nm_deprecated("Don't use this API") void _nm_forbidden_glib_api_n(gconstpointer arg0, ...);
#undef g_cancellable_reset
-#define g_cancellable_reset(cancellable) _nm_g_cancellable_reset(cancellable)
+#define g_cancellable_reset(cancellable) _nm_forbidden_glib_api_n(cancellable)
+
+#undef g_idle_remove_by_data
+#define g_idle_remove_by_data(data) _nm_forbidden_glib_api_n(data)
+
+#undef g_source_remove_by_funcs_user_data
+#define g_source_remove_by_funcs_user_data(funcs, user_data) \
+ _nm_forbidden_glib_api_n(funcs, user_data)
+
+#undef g_source_remove_by_user_data
+#define g_source_remove_by_user_data(user_data) _nm_forbidden_glib_api_n(user_data)
/*****************************************************************************/