Skip to content

Commit b988947

Browse files
committed
Ensure the texture garbage collector never runs during gameplay.
1 parent 0d2688c commit b988947

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/RageTextureManager.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "RageDisplay.h"
2828
#include "Foreach.h"
2929
#include "ActorUtil.h"
30+
#include "Screen.h"
31+
#include "ScreenManager.h"
3032

3133
#include <map>
3234

@@ -61,10 +63,13 @@ void RageTextureManager::Update( float fDeltaTime )
6163
static RageTimer garbageCollector;
6264
if (garbageCollector.PeekDeltaTime() >= 30.0f)
6365
{
64-
DoDelayedDelete();
65-
garbageCollector.Touch();
66-
}
67-
66+
if (SCREENMAN && SCREENMAN->GetTopScreen() &&
67+
SCREENMAN->GetTopScreen()->GetScreenType() != gameplay)
68+
{
69+
DoDelayedDelete();
70+
garbageCollector.Touch();
71+
}
72+
}
6873

6974
FOREACHM(RageTextureID, RageTexture*, m_textures_to_update, i)
7075
{

0 commit comments

Comments
 (0)