display: Prevent error when serializing invalid configuration
If no monitors are enabled, then the variant would end up with an invalid variant type, causing a crash later on. This case only happened due to other bugs (i.e. in principle we should never send a configuration without any monitors to the server). Prevent the serialization error by specifying the correct type for the builder, therefore potentially preventing a crash in such a corner case.
This commit is contained in:
parent
0c4e84e417
commit
ae22f72cac
1 changed files with 1 additions and 1 deletions
|
@ -951,7 +951,7 @@ build_logical_monitors_parameter (CcDisplayConfigDBus *self)
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
CcDisplayLogicalMonitor *logical_monitor;
|
CcDisplayLogicalMonitor *logical_monitor;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(iiduba(ssa{sv}))"));
|
||||||
g_hash_table_iter_init (&iter, self->logical_monitors);
|
g_hash_table_iter_init (&iter, self->logical_monitors);
|
||||||
|
|
||||||
while (g_hash_table_iter_next (&iter, (void **) &logical_monitor, NULL))
|
while (g_hash_table_iter_next (&iter, (void **) &logical_monitor, NULL))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue