summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-01-23 19:08:42 +0100
committerSergeanur <s.anureev@yandex.ua>2020-01-23 19:08:42 +0100
commitb06ad84768e314eb20327ec7ec8200da292dd55c (patch)
treede2377a69be92fa20ef791b10aef5a217be02588 /src
parentFixing some plane funcs declarations (diff)
downloadre3-b06ad84768e314eb20327ec7ec8200da292dd55c.tar
re3-b06ad84768e314eb20327ec7ec8200da292dd55c.tar.gz
re3-b06ad84768e314eb20327ec7ec8200da292dd55c.tar.bz2
re3-b06ad84768e314eb20327ec7ec8200da292dd55c.tar.lz
re3-b06ad84768e314eb20327ec7ec8200da292dd55c.tar.xz
re3-b06ad84768e314eb20327ec7ec8200da292dd55c.tar.zst
re3-b06ad84768e314eb20327ec7ec8200da292dd55c.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/Instance.cpp7
-rw-r--r--src/core/Instance.h1
-rw-r--r--src/modelinfo/ModelInfo.cpp20
3 files changed, 26 insertions, 2 deletions
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();
};
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index a3c1412d..d956abaa 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -93,16 +93,32 @@ CModelInfo::ShutDown(void)
int i;
for(i = 0; i < ms_simpleModelStore.allocPtr; i++)
ms_simpleModelStore.store[i].Shutdown();
+ for(i = 0; i < ms_mloInstanceStore.allocPtr; i++)
+ ms_mloInstanceStore.store[i].Shutdown();
for(i = 0; i < ms_timeModelStore.allocPtr; i++)
ms_timeModelStore.store[i].Shutdown();
for(i = 0; i < ms_clumpModelStore.allocPtr; i++)
ms_clumpModelStore.store[i].Shutdown();
- for(i = 0; i < ms_pedModelStore.allocPtr; i++)
- ms_pedModelStore.store[i].Shutdown();
for(i = 0; i < ms_vehicleModelStore.allocPtr; i++)
ms_vehicleModelStore.store[i].Shutdown();
+ for(i = 0; i < ms_pedModelStore.allocPtr; i++)
+ ms_pedModelStore.store[i].Shutdown();
+ for(i = 0; i < ms_xtraCompsModelStore.allocPtr; i++)
+ ms_xtraCompsModelStore.store[i].Shutdown();
+ for(i = 0; i < ms_mloInstanceStore.allocPtr; i++)
+ ms_mloInstanceStore.store[i].Shutdown();
for(i = 0; i < ms_2dEffectStore.allocPtr; i++)
ms_2dEffectStore.store[i].Shutdown();
+
+ ms_2dEffectStore.clear();
+ ms_simpleModelStore.clear();
+ ms_mloInstanceStore.clear();
+ ms_mloModelStore.clear();
+ ms_xtraCompsModelStore.clear();
+ ms_timeModelStore.clear();
+ ms_pedModelStore.clear();
+ ms_clumpModelStore.clear();
+ ms_vehicleModelStore.clear();
}
CSimpleModelInfo*