Commit 2b0a359
committed
Cleanup stale camera workers on start/shutdown
Detect and remove stale camera worker/thread state when starting cameras and during shutdown. _start_camera now checks the existing thread for a cam_id and calls _cleanup_camera if the worker exists but the thread is missing or not running, and updates the log message to indicate the camera is already running. The shutdown loop likewise invokes _cleanup_camera for None or not-running threads and after successful quit/terminate waits to ensure worker/thread entries are cleared. These changes prevent stale entries from blocking restarts and ensure cleaner shutdown behavior.1 parent 91dff83 commit 2b0a359
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 | | |
176 | | - | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
| 234 | + | |
230 | 235 | | |
231 | 236 | | |
| 237 | + | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
| |||
243 | 250 | | |
244 | 251 | | |
245 | 252 | | |
| 253 | + | |
246 | 254 | | |
247 | 255 | | |
248 | 256 | | |
| |||
0 commit comments