Function

GObjectClosurenew_object

Declaration

GClosure*
g_closure_new_object (
  guint sizeof_closure,
  GObject* object
)

Description

A variant of g_closure_new_simple() which stores object in the data field of the closure and calls g_object_watch_closure() on object and the created closure. This function is mainly useful when implementing new types of closures.

Parameters

sizeof_closure guint
 

The size of the structure to allocate, must be at least sizeof (GClosure)

object GObject
 

A GObject pointer to store in the data field of the newly allocated GClosure.

 The data is owned by the caller of the function.

Return value

Returns: GClosure
 

A newly allocated GClosure.

 The caller of the function takes ownership of the data, and is responsible for freeing it.