Commit 90f1e55c authored by Sjoerd Simons's avatar Sjoerd Simons

Keep our GMainContext referenced

We need to keep the GMainContext referenced so we can be sure it's
still alive when we remove the sources we've attached to it.
parent cb9e8565
......@@ -819,6 +819,8 @@ nice_agent_set_property (
{
case PROP_MAIN_CONTEXT:
agent->main_context = g_value_get_pointer (value);
if (agent->main_context != NULL)
g_main_context_ref (agent->main_context);
break;
case PROP_COMPATIBILITY:
......@@ -2452,6 +2454,10 @@ nice_agent_dispose (GObject *object)
g_free (agent->software_attribute);
agent->software_attribute = NULL;
if (agent->main_context != NULL)
g_main_context_unref (agent->main_context);
agent->main_context = NULL;
if (G_OBJECT_CLASS (nice_agent_parent_class)->dispose)
G_OBJECT_CLASS (nice_agent_parent_class)->dispose (object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment