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:
@@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user