]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't leak AsyncUpdaters if Mesh async loading is aborted
authorMikko Rasa <tdb@tdb.fi>
Tue, 30 Sep 2014 17:14:28 +0000 (20:14 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 30 Sep 2014 17:14:28 +0000 (20:14 +0300)
source/mesh.cpp

index 055345faed1f17586de0c9c93d204f4c7956e985..3e9e118ac52e6a9eb40b47345cce0f9692d9b140 100644 (file)
@@ -283,6 +283,8 @@ Mesh::AsyncLoader::AsyncLoader(Mesh &m, IO::Seekable &i):
 Mesh::AsyncLoader::~AsyncLoader()
 {
        mesh.disallow_rendering = false;
+       delete vertex_updater;
+       delete index_updater;
 }
 
 bool Mesh::AsyncLoader::needs_sync() const
@@ -315,7 +317,9 @@ bool Mesh::AsyncLoader::process()
        else if(phase==3)
        {
                delete vertex_updater;
+               vertex_updater = 0;
                delete index_updater;
+               index_updater = 0;
        }
 
        ++phase;