mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
cursor: Remove cursor_channel_disconnect()
cursor_channel_disconnect() calls cursor_channel_client_reset_cursor_cache() on all CursorChannelClient associated with the current CursorChannel before calling red_channel_disconnect(). red_channel_disconnect() will iterate over all CursorChannelClient calling red_channel_client_disconnect(), which will eventually call CursorChannelClient::on_disconnect. This will in turn cursor_channel_client_reset_cursor_cache(), so calling it in cursor_channel_disconnect() before calling red_channel_disconnect() is redundant. cursor_channel_disconnect() can thus be replaced by a direct call to red_channel_disconnect(). Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
54eb7716f0
commit
becd0d30f6
@ -158,17 +158,6 @@ static void cursor_fill(CursorChannelClient *ccc, CursorItem *cursor,
|
||||
}
|
||||
}
|
||||
|
||||
void cursor_channel_disconnect(CursorChannel *cursor_channel)
|
||||
{
|
||||
RedChannel *channel = RED_CHANNEL(cursor_channel);
|
||||
|
||||
if (!channel || !red_channel_is_connected(channel)) {
|
||||
return;
|
||||
}
|
||||
red_channel_apply_clients(channel, cursor_channel_client_reset_cursor_cache);
|
||||
red_channel_disconnect(channel);
|
||||
}
|
||||
|
||||
static void cursor_pipe_item_free(RedPipeItem *base)
|
||||
{
|
||||
spice_return_if_fail(base);
|
||||
|
||||
@ -59,10 +59,6 @@ GType cursor_channel_get_type(void) G_GNUC_CONST;
|
||||
CursorChannel* cursor_channel_new (RedsState *server, QXLInstance *qxl,
|
||||
const SpiceCoreInterfaceInternal *core);
|
||||
|
||||
/**
|
||||
* Cause the channel to disconnect all clients
|
||||
*/
|
||||
void cursor_channel_disconnect (CursorChannel *cursor);
|
||||
void cursor_channel_reset (CursorChannel *cursor);
|
||||
void cursor_channel_do_init (CursorChannel *cursor);
|
||||
void cursor_channel_process_cmd (CursorChannel *cursor, RedCursorCmd *cursor_cmd);
|
||||
|
||||
@ -363,7 +363,7 @@ static void flush_display_commands(RedWorker *worker)
|
||||
static void red_disconnect_cursor(RedWorker *worker)
|
||||
{
|
||||
spice_warning("flush cursor timeout");
|
||||
cursor_channel_disconnect(worker->cursor_channel);
|
||||
red_channel_disconnect(RED_CHANNEL(worker->cursor_channel));
|
||||
}
|
||||
|
||||
static void flush_cursor_commands(RedWorker *worker)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user