From 82a74fed61a305c96143c75c10694181368b2dae Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:31:14 +0200 Subject: [PATCH] Try one more idea.. --- Source/core/Proxy.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/core/Proxy.h b/Source/core/Proxy.h index eaf64c6b7..9942760a7 100644 --- a/Source/core/Proxy.h +++ b/Source/core/Proxy.h @@ -87,16 +87,18 @@ namespace Thunder { Space = reinterpret_cast(::malloc(alignedSize)); } - return Space; + return reinterpret_cast(Space); } // Somehow Purify gets lost if we do not delete it, overide the delete operator void operator delete( void* stAllocateBlock) { - uint8_t* originalPtr = reinterpret_cast(stAllocateBlock) - sizeof(void*); - reinterpret_cast*>(originalPtr)->__Destructed(); - ::free(originalPtr); + if (stAllocateBlock != nullptr) { + uint8_t* originalPtr = reinterpret_cast(stAllocateBlock) - sizeof(void*); + reinterpret_cast*>(originalPtr)->__Destructed(); + ::free(originalPtr); + } } public: