Skip to content

Commit 7a1bb10

Browse files
committed
Add XXX
Set unique pointers to nullptr instead of calling close(). They will automatically call it.
1 parent df87e7d commit 7a1bb10

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/xrEngine/EngineAPI.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ void CEngineAPI::InitializeRenderers()
122122
// ask current renderer to setup GlobalEnv
123123
R_ASSERT2(GEnv.SetupCurrentRenderer, "Can't setup renderer");
124124
GEnv.SetupCurrentRenderer();
125+
126+
// Now unload unused renderers
127+
// XXX: Unloading disabled due to typeids invalidation
128+
/*if (GEnv.CurrentRenderer != 4)
129+
hRenderR4->close();
130+
131+
if (GEnv.CurrentRenderer != 3)
132+
hRenderR3->close();
133+
134+
if (GEnv.CurrentRenderer != 2)
135+
hRenderR2->close();
136+
137+
if (GEnv.CurrentRenderer != 1)
138+
hRenderR1->close();*/
125139
}
126140

127141
void CEngineAPI::Initialize(void)
@@ -160,12 +174,12 @@ void CEngineAPI::Initialize(void)
160174

161175
void CEngineAPI::Destroy(void)
162176
{
163-
if (hGame) hGame->close();
164-
if (hTuner) hTuner->close();
165-
if (hRenderR1) hRenderR1->close();
166-
if (hRenderR2) hRenderR2->close();
167-
if (hRenderR3) hRenderR3->close();
168-
if (hRenderR4) hRenderR4->close();
177+
hGame = nullptr;
178+
hTuner = nullptr;
179+
hRenderR1 = nullptr;
180+
hRenderR2 = nullptr;
181+
hRenderR3 = nullptr;
182+
hRenderR4 = nullptr;
169183
pCreate = nullptr;
170184
pDestroy = nullptr;
171185
Engine.Event._destroy();

0 commit comments

Comments
 (0)