### Function

# GLib MainLoop new

#### Declaration

    GMainLoop*
    g_main_loop_new (
      GMainContext* context,
      gboolean is_running
    )

#### Description

Creates a new `GMainLoop` structure.

#### Parameters

`context`

  Type: `GMainContext`

  A `GMainContext` (if `NULL`, the global-default main context will be used).

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

`is_running`

  Type: `gboolean`

  Set to `TRUE` to indicate that the loop is running. This is not very important since calling `g_main_loop_run()` will set this to `TRUE` anyway.

#### Return value

Type: `GMainLoop`

A new `GMainLoop`.

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