mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-08 04:11:52 +00:00
char-device: free all memory pool when no clients
When no client is connect we should not need to keep the memory pool used by char-device. In most situations this is not significant but when using webdav this could mean freeing MAX_POOL_SIZE bytes Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350
This commit is contained in:
parent
2832fdf25a
commit
a263c651e1
@ -826,6 +826,12 @@ void spice_char_device_client_remove(SpiceCharDeviceState *dev,
|
||||
dev->wait_for_migrate_data = FALSE;
|
||||
spice_char_device_read_from_device(dev);
|
||||
}
|
||||
|
||||
if (dev->num_clients == 0) {
|
||||
spice_debug("client removed, memory pool will be freed (%lu bytes)", dev->cur_pool_size);
|
||||
write_buffers_queue_free(&dev->write_bufs_pool);
|
||||
dev->cur_pool_size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int spice_char_device_client_exists(SpiceCharDeviceState *dev,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user