/* Removes a source from its #GMainContext, if any, and mark it as destroyed. The source cannot be subsequently added to another context. It is safe to call this on sources which have already been removed from their context.  */
void g_source_destroy(GSource *source)
/* Removes a source from its #GMainContext, if any, and mark it as destroyed. The source cannot be subsequently added to another context. It is safe to call this on sources which have already been removed from their context.  */
void g_source_destroy(GSource *source)
{
  GMainContext *context;
  g_return_if_fail (source != NULL);
  context = source->context;
  if (context)
    g_source_destroy_internal (source, context, FALSE);
  else
    source->flags &= ~G_HOOK_FLAG_ACTIVE;
}