Skip to content

Commit acaab7a

Browse files
committed
Cleanup every 5 secs
1 parent 6a4ac8b commit acaab7a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Client/mods/deathmatch/logic/CClientRenderElementManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "StdInc.h"
1212
#include "CClientVectorGraphic.h"
1313

14+
constexpr std::int64_t TEMPORARY_TEXTURES_CLEANUP_PERIOD = 5000ll;
1415
constexpr std::int64_t TEMPORARY_TEXTURES_CLEANUP_THRESHOLD = 10000ll;
1516
constexpr std::size_t TEMPORARY_TEXTURES_DELETE_THRESHOLD = 10u;
1617

@@ -358,6 +359,11 @@ void CClientRenderElementManager::Remove(CClientRenderElement* pElement)
358359

359360
void CClientRenderElementManager::DoPulse()
360361
{
362+
if (m_texturePulseTimer.Get() < TEMPORARY_TEXTURES_CLEANUP_PERIOD)
363+
return;
364+
365+
m_texturePulseTimer.Reset();
366+
361367
const CTickCount now = CTickCount::Now();
362368

363369
std::vector<CClientTexture*> deleteCandidates;

Client/mods/deathmatch/logic/CClientRenderElementManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CClientRenderElementManager
5757
CTickCount lastUse;
5858
};
5959

60+
CElapsedTime m_texturePulseTimer;
6061
CClientManager* m_pClientManager;
6162
CRenderItemManagerInterface* m_pRenderItemManager;
6263
std::map<SString, SAutoTexture> m_AutoTextureMap;

0 commit comments

Comments
 (0)