From f50b59702e7698cdbf6073be2ba8fda9d1ba3bb9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 3 Nov 2020 13:55:12 +0800 Subject: [PATCH] Fix memory release --- ryzom/client/src/string_manager_client.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ryzom/client/src/string_manager_client.h b/ryzom/client/src/string_manager_client.h index e3cd736fd..ef55b0367 100644 --- a/ryzom/client/src/string_manager_client.h +++ b/ryzom/client/src/string_manager_client.h @@ -46,6 +46,7 @@ class CStringManagerClient public: // Singleton pattern implementation static CStringManagerClient *instance(); + static bool hasInstance() { return _Instance; } static void release(bool mustReleaseStaticArrays); /** Prepare the string manager to use a persistent string cache. @@ -388,7 +389,8 @@ public: virtual ~IStringWaiterRemover() { // signal the string manager that this waiter is destroyed - CStringManagerClient::instance()->removeStringWaiter(this); + if (CStringManagerClient::hasInstance()) + CStringManagerClient::instance()->removeStringWaiter(this); } }; @@ -406,7 +408,8 @@ public: virtual ~IStringWaitCallback() { // signal the string manager that this waiter is destroyed - CStringManagerClient::instance()->removeStringWaiter(this); + if (CStringManagerClient::hasInstance()) + CStringManagerClient::instance()->removeStringWaiter(this); } };