diff options
| author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2025-09-15 18:27:42 +0200 |
|---|---|---|
| committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2025-09-16 18:19:57 +0200 |
| commit | fcdeb27627935140c05befd436fe5e83a21a8d13 (patch) | |
| tree | 3fc2560a5a3c8f2628da25eb94db51fff2714c1d /src/gui/doc/snippets/code | |
| parent | ac7b5815db7f08b24fbd598e22c13652cae3bb2f (diff) | |
QAppleNetworkInformationBackend: fix races, protect against a dangling pointer
nw_path_monitor's update handler calls our 'updateState' on a dispatch
queue, potentially from a different thread. 'this' pointer captured
by the handler's lambda can be already invalid (if the backend was deleted).
We call nw_path_monitor_cancel in 'stopMonitoring', but it's not enough
to prevent update handler from accessing the (now-invalid) pointer.
To resolve this issue we move the lock and 'this' pointer to the separate
object, which is essentially owned by the callback and will be deleted
by the monitor's cancellation handler, set via
nw_path_monitor_set_cancel_handler.
Pick-to: 6.10
Change-Id: I79f48ef021d19dcba0923ef06690433d167c4ea6
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/doc/snippets/code')
0 files changed, 0 insertions, 0 deletions
