Commit 9b55875
committed
Make notificationObserver storage per-file
MemoryBrowserController.m and PokeMemoryController.m both declared
`id notificationObserver;` at file scope without `static`. The two
translation units emit common symbols (nm against the .o files
shows `C _notificationObserver` in each); the linker merges them
despite GCC_NO_COMMON_BLOCKS=YES on the target, so the controllers
share one storage slot for their addObserverForName: tokens.
Latent while runModal forbade simultaneous visibility — the slot
always held the token of whatever window was currently closing.
Reachable now that the windows coexist: open Memory Browser, open
Poke Memory (lazy init writes PM's token into the now-MB-occupied
slot), close Memory Browser first. MB's block reads the slot,
finds PM's token, removes PM's observer. The next Poke Memory
close has no observer to fire — unpause never runs and
fuse_emulation_paused leaks, freezing the emulator.
Adding `static` to both declarations gives each translation unit
private storage. nm now reports `d _notificationObserver` in each
.o file.1 parent 5686894 commit 9b55875
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments