Commit d78dbe8
refactor(macos): drop the C++ wait helper, keep the minimal GCD fix
The deadlock was caused solely by dispatch_async'ing the permission request onto
the main queue, which never runs when no run loop services it. The fix is just to
delete that bounce and call requestAccessForMediaType: directly on the calling
thread, keeping the original dispatch_semaphore wait.
The earlier ccap_apple_async.h helper (std::mutex/condition_variable) and its unit
test were introduced only to make the path portable-C++-testable, but the file was
macOS-only (portability was moot), the cv-on-the-stack rewrite introduced its own
destroy-after-notify UAF, and the test never exercised ProviderApple::open() -- it
tested the invented helper, not the real code path. GCD's dispatch_semaphore is
simpler and, because the completion block retains the semaphore, has no destroy race.
Removes src/ccap_apple_async.h and tests/test_apple_permission.cpp.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 150f212 commit d78dbe8
4 files changed
Lines changed: 12 additions & 177 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
257 | 255 | | |
258 | 256 | | |
259 | 257 | | |
| 258 | + | |
260 | 259 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
276 | 271 | | |
277 | 272 | | |
278 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
This file was deleted.
0 commit comments