From a44e3be492649a5718da2eea6fa1934e2a84405d Mon Sep 17 00:00:00 2001 From: markm11 Date: Fri, 6 Nov 2020 14:38:47 -0500 Subject: [PATCH] Crash when freeing custom libraries --- PlugY/D2wrapper.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PlugY/D2wrapper.cpp b/PlugY/D2wrapper.cpp index c9e15a3..453727e 100644 --- a/PlugY/D2wrapper.cpp +++ b/PlugY/D2wrapper.cpp @@ -231,7 +231,14 @@ void freeCustomLibraries() dll->release(); freeLibrary(dll->offset); nextDll = dll->nextDll; - D2FogMemDeAlloc(dll,__FILE__,__LINE__,0); + if (version_D2Game == V114d) + { + delete dll; + } + else + { + D2FogMemDeAlloc(dll, __FILE__, __LINE__, 0); + } dll = nextDll; } }