SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 2b709aea4a27d3e5f5779ae56acebf2e4067c728 parent b24c539432f6fda4512a5e1c532744981b27ef09 Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 11 Oct 2025 13:46:38 +0300 Attempt to prevent future Document-ref-leak bugs Diffstat:
| M | Cocoa/Document.m | 20 | +++++++++++++++----- |
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/Cocoa/Document.m b/Cocoa/Document.m @@ -628,6 +628,10 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency) - (void) start { + if (!self.mainWindow) { + NSLog(@"Bug, reference leak to Document %@", self); + return; + } dispatch_async(dispatch_get_main_queue(), ^{ [self updateDebuggerButtons]; [_slave updateDebuggerButtons]; @@ -1375,12 +1379,18 @@ static bool is_path_writeable(const char *path) [_consoleOutputLock lock]; [_consoleOutputTimer invalidate]; [_consoleOutputLock unlock]; - [self.consoleWindow close]; - [self.memoryWindow close]; - [self.vramWindow close]; - [self.printerFeedWindow close]; - [self.cheatsWindow close]; + [_consoleWindow close]; + _consoleWindow = nil; + [_memoryWindow close]; + _memoryWindow = nil; + [_vramWindow close]; + _vramWindow = nil; + [_printerFeedWindow close]; + _printerFeedWindow = nil; + [_cheatsWindow close]; + _cheatsWindow = nil; [_cheatSearchController.window close]; + _cheatSearchController.window = nil; [super close]; }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.