mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 02:12:45 +01:00
rwlib: Delete textures on close
Should fix these memory leaks: ==22737== 513,622,016 bytes in 6,650 blocks are definitely lost in loss record 3,126 of 3,126 ==22737== at 0x14F996E4: ??? (in /usr/lib64/dri/i965_dri.so) ==22737== by 0x14FE717A: ??? (in /usr/lib64/dri/i965_dri.so) ==22737== by 0x14FE622E: ??? (in /usr/lib64/dri/i965_dri.so) ==22737== by 0x14CDED2A: ??? (in /usr/lib64/dri/i965_dri.so) ==22737== by 0x14CDF85F: ??? (in /usr/lib64/dri/i965_dri.so) ==22737== by 0x91602C: createTexture(RW::BSTextureNative&, RW::BinaryStreamSection&) (LoaderTXD.cpp:79) ==22737== by 0x91649E: TextureLoader::loadFromMemory(std::shared_ptr<FileContentsInfo>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<TextureData>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<TextureData> > > >&) (LoaderTXD.cpp:183) ==22737== by 0x7BBCE0: GameData::loadTextureArchive(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameData.cpp:372) ==22737== by 0x7BBABA: GameData::loadTXD(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameData.cpp:358) ==22737== by 0x7BCA80: GameData::loadModel(unsigned short) (GameData.cpp:466) ==22737== by 0x7DF7BC: GameWorld::createInstance(unsigned short, glm::tvec3<float, (glm::precision)0> const&, glm::tquat<float, (glm::precision)0> const&) (GameWorld.cpp:144) ==22737== by 0x7DF44C: GameWorld::placeItems(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameWorld.cpp:120)
This commit is contained in:
parent
7e4e1db85d
commit
5ff31db04f
@ -14,6 +14,10 @@ public:
|
||||
: texName(name), size(dims), hasAlpha(alpha) {
|
||||
}
|
||||
|
||||
~TextureData() {
|
||||
glDeleteTextures(1, &texName);
|
||||
}
|
||||
|
||||
GLuint getName() const {
|
||||
return texName;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user