Jonas Ådahl ad371a4435 color-device: Don't write to fields when cancelled
Writing to fields (in this case the MetaColorDevice::pending_state) in
response to an asynchronous operation that was cancelled means we'll
write to an arbitrary memory location, potentially causing segmentation
faults or memory corruption.

Avoid these segfaults or memory corruption by only updating state if we
weren't cancelled. Also avoid trying to dereference the device pointer
if we're cancelled.

The memory corruption due to this has been causing test flakyness in the
monitor unit tests due, which should now hopefully be fixed.

Fixes: 19837796fe39b7ab83a10721e0c9d8fb748437c4
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2794>
2023-01-20 15:34:53 +00:00
..
2019-10-21 14:04:30 +00:00
2019-01-22 18:31:53 +01:00
2022-03-04 10:10:05 +03:00