mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-04 09:10:27 +02:00
Hardware meshbuffers are now deleted when they hold the last reference to a meshbuffer
HW buffers were keeping meshbuffers alive for 20000 frames even when no one else was using them anymore. In cases of rapid creating/destroying static meshbuffers this could lead to serious memory leaks (which then kinda topped out after 5 minutes, but at that point it could already be too late). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6599 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -1815,7 +1815,7 @@ void CNullDriver::updateAllHardwareBuffers()
|
||||
SHWBufferLink *Link=Iterator.getNode()->getValue();
|
||||
|
||||
Link->LastUsed++;
|
||||
if (Link->LastUsed>20000)
|
||||
if (Link->LastUsed>20000 || Link->MeshBuffer->getReferenceCount() == 1)
|
||||
{
|
||||
deleteHardwareBuffer(Link);
|
||||
|
||||
|
Reference in New Issue
Block a user