mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 14:41:25 +00:00
cursor: Avoid cursor item leak
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
e1cc694a72
commit
cd57ce246c
@ -437,11 +437,26 @@ void cursor_channel_connect(CursorChannel *cursor, RedClient *client, RedsStream
|
||||
cursor_channel_init_client(cursor, ccc);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_channel_finalize(GObject *object)
|
||||
{
|
||||
CursorChannel *self = CURSOR_CHANNEL(object);
|
||||
|
||||
if (self->item) {
|
||||
cursor_item_unref(self->item);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS(cursor_channel_parent_class)->finalize(object);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_channel_class_init(CursorChannelClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
RedChannelClass *channel_class = RED_CHANNEL_CLASS(klass);
|
||||
|
||||
object_class->finalize = cursor_channel_finalize;
|
||||
|
||||
channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_CURSOR, NULL);
|
||||
channel_class->handle_parsed = red_channel_client_handle_message;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user