From b06ad84768e314eb20327ec7ec8200da292dd55c Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 23 Jan 2020 20:08:42 +0200 Subject: Fixing possible leaks in CModelInfo::ShutDown --- src/core/Instance.cpp | 7 +++++++ src/core/Instance.h | 1 + 2 files changed, 8 insertions(+) (limited to 'src/core') diff --git a/src/core/Instance.cpp b/src/core/Instance.cpp index 5426605f..775341be 100644 --- a/src/core/Instance.cpp +++ b/src/core/Instance.cpp @@ -2,6 +2,12 @@ #include "patcher.h" #include "Instance.h" +void +CInstance::Shutdown() +{ + GetMatrix().Detach(); +} + class CInstance_ : public CInstance { public: @@ -10,4 +16,5 @@ public: STARTPATCHES InjectHook(0x50BE90, &CInstance_::dtor, PATCH_JUMP); + InjectHook(0x50B850, &CInstance::Shutdown, PATCH_JUMP); ENDPATCHES diff --git a/src/core/Instance.h b/src/core/Instance.h index 4a7f9aa9..01dfb6a2 100644 --- a/src/core/Instance.h +++ b/src/core/Instance.h @@ -10,4 +10,5 @@ public: int m_modelIndex; public: ~CInstance() = default; + void Shutdown(); }; -- cgit v1.2.3