GSMemoryPanel: Only call GSDebug* in debug mode (#289)

The GSDebug* methods are conditional on NDEBUG not being defined; so do not attempt to call these methods if this variable is not set.
This commit is contained in:
Frederik Carlier 2024-09-14 10:31:42 +02:00 committed by GitHub
parent 6a3681aa82
commit 3784462321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -191,7 +191,9 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
NSButton *button;
/* Activate debugging of allocation. */
#ifndef NDEBUG
GSDebugAllocationActive (YES);
#endif
hbox = [GSHbox new];
[hbox setDefaultMinXMargin: 5];
@ -359,6 +361,7 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
- (void) update: (id)sender
{
#ifndef NDEBUG
Class *classList = GSDebugAllocationClassList ();
Class *pointer;
GSMemoryPanelEntry *entry;
@ -388,6 +391,7 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
NSZoneFree(NSDefaultMallocZone(), classList);
[array sortUsingSelector: orderingBy];
#endif
[table reloadData];
}