mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 15:33:39 +02:00
gobject: add internal g_destroy_notify_assert_not_reached() helper
This is a GDestoryNotify that asserts not to be called. Obviously, this is only for testing and asserting (defensive programming). It is private API inside "libgobject-2.0.so.0". If unused, we rely that the linker can strip it out.
This commit is contained in:
@@ -99,6 +99,8 @@ gboolean _g_object_has_signal_handler (GObject *object);
|
||||
void _g_object_set_has_signal_handler (GObject *object,
|
||||
guint signal_id);
|
||||
|
||||
void g_destroy_notify_assert_not_reached (gpointer object);
|
||||
|
||||
/**
|
||||
* _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE:
|
||||
*
|
||||
|
@@ -4848,3 +4848,9 @@ g_type_ensure (GType type)
|
||||
if (G_UNLIKELY (type == (GType)-1))
|
||||
g_error ("can't happen");
|
||||
}
|
||||
|
||||
void
|
||||
g_destroy_notify_assert_not_reached (gpointer object)
|
||||
{
|
||||
g_return_if_reached ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user