From 8fc91bbc1e99ca9fd9e337f9cac7650afeed3c21 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sun, 11 May 2025 15:54:03 +0100 Subject: [PATCH] Revert "Update console.h" This reverts commit ffac34b2d3eb24ec6a460f2cf77e172543c15772. --- Engine/source/console/console.h | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index e2a014024..e5ba8ffe7 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -161,29 +161,16 @@ class ConsoleValue TORQUE_FORCEINLINE void cleanupData() { - switch (type) - { - case ConsoleValueType::cvConsoleValueType: - if (ct) - { - delete ct; - ct = nullptr; - } - break; - case ConsoleValueType::cvString: - if (s && s != StringTable->EmptyString()) - dFree(s); - break; - default: - break; - } - - if (data != NULL) + if (hasAllocatedData()) { dFree(data); data = NULL; } - + else if (type == ConsoleValueType::cvString) + { + if (s != StringTable->EmptyString()) + dFree(s); + } type = ConsoleValueType::cvNULL; }