### Function

# GObject signal_connect_object

#### Declaration [src]

    gulong
    g_signal_connect_object (
      GObjectTypeInstance* instance,
      const gchar* detailed_signal,
      GCallback c_handler,
      GObject* gobject,
      GConnectFlags connect_flags
    )

#### Description [src]

This is similar to g_signal_connect_data(), but uses a closure which ensures that the `gobject` stays alive during the call to `c_handler` by temporarily adding a reference count to `gobject`.

When the `gobject` is destroyed the signal handler will be automatically disconnected. Note that this is not currently threadsafe (ie: emitting a signal while `gobject` is being destroyed in another thread is not safe).

This function cannot fail. If the given signal name doesn’t exist, a critical warning is emitted. No validation is performed on the “detail” string when specified in `detailed_signal`, other than a non-empty check.

Refer to the signals documentation for more details.

This function is not directly available to language bindings.

#### Parameters

`instance`

  Type: `GTypeInstance`

  The instance to connect to.

  The data is owned by the caller of the function.

`detailed_signal`

  Type: `const gchar*`

  A string of the form “signal-name::detail”.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`c_handler`

  Type: `GCallback`

  The `GCallback` to connect.

`gobject`

  Type: `GObject`

  The object to pass as data to `c_handler`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`connect_flags`

  Type: `GConnectFlags`

  A combination of `GConnectFlags`.

#### Return value

Type: `gulong`

The handler id.