Skip to content

Commit 9b55875

Browse files
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

File tree

fusepb/controllers/MemoryBrowserController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
@implementation MemoryBrowserController
3333

34-
id notificationObserver;
34+
static id notificationObserver;
3535

3636
- (id)init
3737
{

fusepb/controllers/PokeMemoryController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
@implementation PokeMemoryController
3535

36-
id notificationObserver;
36+
static id notificationObserver;
3737

3838
- (id)init
3939
{

0 commit comments

Comments
 (0)