mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2026-01-08 21:14:16 +00:00
session: Only create a hashtable if apply_monitor_geometry vfunc exists
Creating the monitors hashtable only after checking for the existence of apply_monitor_geometry vfunc avoids leaking the hashtable in the case where the vfunc doesn't exist. Related: rhbz#1267184
This commit is contained in:
parent
50f7d3dff8
commit
73b55b3e1b
@ -405,13 +405,15 @@ virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
|
||||
VirtViewerSessionClass *klass;
|
||||
gboolean all_fullscreen = TRUE;
|
||||
/* GHashTable<gint, GdkRectangle*> */
|
||||
GHashTable *monitors = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
|
||||
GHashTable *monitors;
|
||||
GList *l;
|
||||
|
||||
klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
|
||||
if (!klass->apply_monitor_geometry)
|
||||
return;
|
||||
|
||||
monitors = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
|
||||
|
||||
for (l = self->priv->displays; l; l = l->next) {
|
||||
VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
|
||||
guint nth = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user