
#include <glib-object.h>

static void
toggle_notify (gpointer data,
               GObject *obj,
               gboolean is_last)
{
  g_debug ("Is last: %d", is_last);
}

int
main (int argc,
      char **argv)
{
  gpointer obj;

  g_type_init ();

  obj = g_object_new (G_TYPE_OBJECT, NULL);

  g_object_add_toggle_ref (obj, toggle_notify, NULL);
  g_object_add_toggle_ref (obj, toggle_notify, NULL);
  g_object_unref (obj);
  g_object_remove_toggle_ref (obj, toggle_notify, NULL);
}
