Bugfix #30 : Reimplemented MediaImpl removing the defective queue system and implementing a thread-safe system. Removed the memory leaks previously shown by valgrind.

This commit is contained in:
Tats
2014-10-20 17:00:22 +00:00
parent c00bf868ad
commit 7fe2a1f1a7
5 changed files with 103 additions and 73 deletions
+2
View File
@@ -324,12 +324,14 @@ void TextureMapper::_preDraw(QPainter* painter)
glBindTexture(GL_TEXTURE_2D, texture->getTextureId());
// Copy bits to texture iff necessary.
texture->lockMutex();
if (texture->bitsHaveChanged())
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
texture->getWidth(), texture->getHeight(), 0, GL_RGBA,
GL_UNSIGNED_BYTE, texture->getBits());
}
texture->unlockMutex();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);