mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-14 00:17:35 +00:00
call: Temporarily hold ref while setting new state
This is needed to make sure the object stays alive, because some implementations will unref the call after it has been set to a disconnected state. This has become apparent because tests started failing when origins switched from the "state-changed" to the "notify::state" signal (as is done in the next commits).
This commit is contained in:
parent
c2c8b1acd9
commit
656643c522
1 changed files with 4 additions and 0 deletions
|
@ -390,11 +390,15 @@ calls_call_set_state (CallsCall *self,
|
||||||
|
|
||||||
priv->state = state;
|
priv->state = state;
|
||||||
|
|
||||||
|
g_object_ref (G_OBJECT (self));
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_STATE]);
|
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_STATE]);
|
||||||
g_signal_emit_by_name (CALLS_CALL (self),
|
g_signal_emit_by_name (CALLS_CALL (self),
|
||||||
"state-changed",
|
"state-changed",
|
||||||
state,
|
state,
|
||||||
old_state);
|
old_state);
|
||||||
|
|
||||||
|
g_object_unref (G_OBJECT (self));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue