mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-06 21:22:55 +00:00
reds: Check we don't register a channel twice in reds_register_channel
To avoid potential regressions, check it only if extra checks are enabled. This allows to check previous "Move channel registration to constructed vfunc" commit. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
parent
52f716e1d2
commit
c213bbe7cf
@ -380,6 +380,14 @@ void stat_remove_counter(SpiceServer *reds, RedStatCounter *counter)
|
||||
void reds_register_channel(RedsState *reds, RedChannel *channel)
|
||||
{
|
||||
spice_assert(reds);
|
||||
|
||||
uint32_t this_type, this_id;
|
||||
g_object_get(channel, "channel-type", &this_type, "id", &this_id, NULL);
|
||||
if (spice_extra_checks) {
|
||||
g_assert(reds_find_channel(reds, this_type, this_id) == NULL);
|
||||
} else {
|
||||
g_warn_if_fail(reds_find_channel(reds, this_type, this_id) == NULL);
|
||||
}
|
||||
reds->channels = g_list_prepend(reds->channels, channel);
|
||||
// create new channel in the client if possible
|
||||
main_channel_registered_new_channel(reds->main_channel, channel);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user