void _owr_session_clear_closures(OwrSession *session) { if (session->priv->on_remote_candidate) { g_closure_invalidate(session->priv->on_remote_candidate); g_closure_unref(session->priv->on_remote_candidate); session->priv->on_remote_candidate = NULL; } if (session->priv->on_local_candidate_change) { g_closure_invalidate(session->priv->on_local_candidate_change); g_closure_unref(session->priv->on_local_candidate_change); session->priv->on_local_candidate_change = NULL; } }
static void thunar_uca_provider_child_watch_destroy (gpointer user_data, GClosure *closure) { ThunarUcaProvider *uca_provider = THUNAR_UCA_PROVIDER (user_data); GClosure *child_watch; /* leave if the closure is not the one we're watching */ if (uca_provider->child_watch == closure || closure == NULL) { /* reset child watch and path */ if (G_UNLIKELY (uca_provider->child_watch != NULL)) { child_watch = uca_provider->child_watch; uca_provider->child_watch = NULL; g_closure_invalidate (child_watch); g_closure_unref (child_watch); } g_free (uca_provider->child_watch_path); uca_provider->child_watch_path = NULL; } }
static VALUE rg_invalidate(VALUE self) { GClosure* closure = RVAL2BOXED(self, G_TYPE_CLOSURE); g_closure_invalidate(closure); return self; }
static void closure_destroy_notify(void *data) { GClosure *closure; closure = data; g_closure_invalidate(closure); g_closure_unref(closure); }
static void meth_free (MooPluginMeth *meth) { if (meth) { g_free (meth->param_types); g_closure_invalidate (meth->closure); g_closure_unref (meth->closure); g_free (meth); } }
void _owr_data_channel_clear_closures(OwrDataChannel *data_channel) { OwrDataChannelPrivate *priv = data_channel->priv; if (priv->on_datachannel_send) { g_closure_invalidate(priv->on_datachannel_send); g_closure_unref(priv->on_datachannel_send); priv->on_datachannel_send = NULL; } if (priv->on_request_bytes_sent) { g_closure_invalidate(priv->on_request_bytes_sent); g_closure_unref(priv->on_request_bytes_sent); priv->on_request_bytes_sent = NULL; } if (priv->on_datachannel_close) { g_closure_invalidate(priv->on_datachannel_close); g_closure_unref(priv->on_datachannel_close); priv->on_datachannel_close = NULL; } }
/** * _owr_data_channel_set_on_request_bytes_sent: * @data_channel: * @on_request_bytes_sent: (transfer full): * */ void _owr_data_channel_set_on_request_bytes_sent(OwrDataChannel *data_channel, GClosure *on_request_bytes_sent) { OwrDataChannelPrivate *priv = data_channel->priv; if (priv->on_request_bytes_sent) { g_closure_invalidate(priv->on_request_bytes_sent); g_closure_unref(priv->on_request_bytes_sent); } priv->on_request_bytes_sent = on_request_bytes_sent; if (on_request_bytes_sent) g_closure_set_marshal(priv->on_request_bytes_sent, g_cclosure_marshal_generic); }
/** * _owr_data_channel_set_on_send: * @data_channel: * @on_datachannel_send: (transfer full): * */ void _owr_data_channel_set_on_send(OwrDataChannel *data_channel, GClosure *on_datachannel_send) { OwrDataChannelPrivate *priv = data_channel->priv; if (priv->on_datachannel_send) { g_closure_invalidate(priv->on_datachannel_send); g_closure_unref(priv->on_datachannel_send); } priv->on_datachannel_send = on_datachannel_send; if (on_datachannel_send) g_closure_set_marshal(priv->on_datachannel_send, g_cclosure_marshal_generic); }
static void invalidate_js_pointers(Closure *c) { if (c->obj == NULL) return; c->obj = NULL; c->context = NULL; c->runtime = NULL; /* Notify any closure reference holders they * may want to drop references. */ g_closure_invalidate(&c->base); }
void g_closure_unref (GClosure *closure) { g_return_if_fail (closure != NULL); g_return_if_fail (closure->ref_count > 0); if (closure->ref_count == 1) /* last unref, invalidate first */ g_closure_invalidate (closure); closure->ref_count -= 1; if (closure->ref_count == 0) { closure_invoke_notifiers (closure, FNOTIFY); g_free (closure->notifiers); g_free (closure); } }
static void e_soup_ssl_trust_message_finalized_cb (gpointer data, GObject *unused_message) { ESoupSslTrustData *handler; /* The network event handler will be disconnected from the message just * before this is called. */ handler = data; g_clear_object (&handler->source); /* Synchronously disconnects the accept certificate handler from all * GTlsConnections. */ g_closure_invalidate (handler->accept_certificate_closure); g_closure_unref (handler->accept_certificate_closure); g_free (handler); }
/** * g_closure_unref: * @closure: #GClosure to decrement the reference count on * * Decrements the reference count of a closure after it was previously * incremented by the same caller. If no other callers are using the * closure, then the closure will be destroyed and freed. */ void g_closure_unref (GClosure *closure) { guint new_ref_count; g_return_if_fail (closure != NULL); g_return_if_fail (closure->ref_count > 0); if (closure->ref_count == 1) /* last unref, invalidate first */ g_closure_invalidate (closure); DEC_ASSIGN (closure, ref_count, &new_ref_count); if (new_ref_count == 0) { closure_invoke_notifiers (closure, FNOTIFY); g_free (closure->notifiers); g_free (closure); } }
static void free_accel_closures (GtkApplicationWindow *window) { GSList *l; for (l = window->priv->accel_closures; l; l = l->next) { AccelClosure *closure = l->data; gtk_accel_group_disconnect (window->priv->accels, &closure->closure); g_object_unref (closure->closure.data); if (closure->parameter) g_variant_unref (closure->parameter); g_free (closure->action_name); g_closure_invalidate (&closure->closure); g_closure_unref (&closure->closure); } g_slist_free (window->priv->accel_closures); window->priv->accel_closures = NULL; }
static void rclosure_marshal(GClosure* closure, GValue* return_value, guint n_param_values, const GValue* param_values, gpointer invocation_hint, gpointer marshal_data) { struct marshal_arg arg; if (!rclosure_initialized) { g_closure_invalidate(closure); return; } arg.closure = closure; arg.return_value = return_value; arg.n_param_values = n_param_values; arg.param_values = param_values; arg.invocation_hint = invocation_hint; arg.marshal_data = marshal_data; G_PROTECT_CALLBACK(rclosure_marshal_do, &arg); }
void frameDestroyed() { g_closure_invalidate(m_closure); FrameDestructionObserver::frameDestroyed(); }