openpilot
openpilot copied to clipboard
ui: fix thread-safety issue by passing a copy of the network list to callbacks
Previously, the original mutable network list (self._networks) was passed directly to callbacks. This could cause race conditions.
Example from logging:
Enqueuing callback: <bound method NetworkLayoutMici._on_network_updated of <...NetworkLayoutMici object at 0x7f638b3e3390>> with args: id: 140065515005056
Processing network update in UI with arg id: 140065515005056
The same object ID appears in both threads, confirming that the mutable object was shared.
Change: Pass a copy of the network list to callbacks to ensure each thread works with an independent, thread-safe snapshot.
raylib UI Preview
All Screenshots
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Why close?