/* Note that g_closure_invalidate() will also be called when the reference count of a closure drops to zero (unless it has already been invalidated before).  */
void g_closure_invalidate(GClosure *closure)
/* Note that g_closure_invalidate() will also be called when the reference count of a closure drops to zero (unless it has already been invalidated before).  */
void g_closure_invalidate(GClosure *closure)
{
  g_return_if_fail (closure != NULL);
  if (!closure->is_invalid)
    {
      gboolean was_invalid;
      g_closure_ref (closure);
      SWAP (closure, is_invalid, TRUE, &was_invalid);
      if (!was_invalid)
        closure_invoke_notifiers (closure, INOTIFY);
      g_closure_unref (closure);
    }
}