From 8cb08d21e925b792fb284e226349941470bdaea5 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Fri, 13 Sep 2024 00:08:14 +0200 Subject: [PATCH] GSMemoryPanel: Only call GSDebug* in debug mode The GSDebug* methods are conditional on NDEBUG not being defined; so do not attempt to call these methods if this variable is not set. --- Source/GSMemoryPanel.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/GSMemoryPanel.m b/Source/GSMemoryPanel.m index 0366154d1f..b3c05a04d6 100644 --- a/Source/GSMemoryPanel.m +++ b/Source/GSMemoryPanel.m @@ -191,7 +191,9 @@ - (id) init NSButton *button; /* Activate debugging of allocation. */ +#ifndef NDEBUG GSDebugAllocationActive (YES); +#endif hbox = [GSHbox new]; [hbox setDefaultMinXMargin: 5]; @@ -359,6 +361,7 @@ - (void) snapshot: (id)sender - (void) update: (id)sender { +#ifndef NDEBUG Class *classList = GSDebugAllocationClassList (); Class *pointer; GSMemoryPanelEntry *entry; @@ -388,6 +391,7 @@ - (void) update: (id)sender NSZoneFree(NSDefaultMallocZone(), classList); [array sortUsingSelector: orderingBy]; +#endif [table reloadData]; }