Skip to content

Commit

Permalink
GSMemoryPanel: Only call GSDebug* in debug mode (#289)
Browse files Browse the repository at this point in the history
The GSDebug* methods are conditional on NDEBUG not being defined; so do not attempt to call these methods if this variable is not set.
  • Loading branch information
qmfrederik authored Sep 14, 2024
1 parent 6a3681a commit 3784462
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/GSMemoryPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ - (id) init
NSButton *button;

/* Activate debugging of allocation. */
#ifndef NDEBUG
GSDebugAllocationActive (YES);
#endif

hbox = [GSHbox new];
[hbox setDefaultMinXMargin: 5];
Expand Down Expand Up @@ -359,6 +361,7 @@ - (void) snapshot: (id)sender

- (void) update: (id)sender
{
#ifndef NDEBUG
Class *classList = GSDebugAllocationClassList ();
Class *pointer;
GSMemoryPanelEntry *entry;
Expand Down Expand Up @@ -388,6 +391,7 @@ - (void) update: (id)sender
NSZoneFree(NSDefaultMallocZone(), classList);

[array sortUsingSelector: orderingBy];
#endif

[table reloadData];
}
Expand Down

0 comments on commit 3784462

Please sign in to comment.