mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 14:41:25 +00:00
smartcard: do not keep weak ref when device is NULL
When a client disconnects, smartcard_channel_client_set_char_device is called with a NULL "device" argument. In that case there is no need to take a weak reference to the device. Without this patch the server complains: g_object_add_weak_pointer: assertion 'G_IS_OBJECT (object)' failed and aborts when a second client attempts to connect. Signed-off-by: Uri Lublin <uril@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
c8e949cea1
commit
889e6273bf
@ -389,8 +389,10 @@ void smartcard_channel_client_set_char_device(SmartCardChannelClient *scc,
|
||||
}
|
||||
|
||||
scc->priv->smartcard = device;
|
||||
g_object_add_weak_pointer(G_OBJECT(scc->priv->smartcard),
|
||||
(gpointer*)&scc->priv->smartcard);
|
||||
if (scc->priv->smartcard) {
|
||||
g_object_add_weak_pointer(G_OBJECT(scc->priv->smartcard),
|
||||
(gpointer*)&scc->priv->smartcard);
|
||||
}
|
||||
}
|
||||
|
||||
RedCharDeviceSmartcard* smartcard_channel_client_get_char_device(SmartCardChannelClient *scc)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user