Fixed crash on exit with Qt 5.15.

This commit is contained in:
Leonardo Zide
2020-07-11 09:17:43 -07:00
parent 6f7dc6f1bb
commit 7ca69e37b7
5 changed files with 23 additions and 40 deletions
+6 -16
View File
@@ -6,7 +6,7 @@
lcStringCache gStringCache;
lcStringCache::lcStringCache()
: mTexture(nullptr), mRefCount(0)
: mTexture(nullptr)
{
}
@@ -15,27 +15,17 @@ lcStringCache::~lcStringCache()
delete mTexture;
}
void lcStringCache::AddRef(lcContext* Context)
void lcStringCache::Initialize(lcContext* Context)
{
Q_UNUSED(Context);
mRefCount++;
if (mRefCount == 1)
mTexture = new lcTexture();
mTexture = new lcTexture();
}
void lcStringCache::Release(lcContext* Context)
void lcStringCache::Reset()
{
mRefCount--;
if (mRefCount == 0)
{
Context->UnbindTexture2D(mTexture->mTexture); // todo: unbind from all contexts
delete mTexture;
mTexture = nullptr;
}
delete mTexture;
mTexture = nullptr;
}
void lcStringCache::CacheStrings(const QStringList& Strings)