servo / core-foundation-rs

Rust bindings to Core Foundation and other low level libraries on Mac OS X and iOS
Other
987 stars 216 forks source link

Fixes a minor race condition in active_displays #686

Closed xanathar closed 2 months ago

xanathar commented 2 months ago

Fixes a minor race condition in active_displays that might happen if a display is removed between the active_display_count and the actual CGGetActiveDisplayList. In that case the returned vec would be inconsistent and contain one (or more) spurious null displays.

Note: the returned value will always be subject to TOC/TOU, of course, but this specific case has the returned value containing invalid displays with id=0 that were never supposed to be in the returned value in any possible state of the displays; this commit fixes this case.