mirror of https://github.com/WerWolv/ImHex
fix: More issues with OpenGL texture deallocation
This commit is contained in:
parent
5f61fe2c4f
commit
041f113402
|
|
@ -260,9 +260,6 @@ namespace ImGuiExt {
|
|||
}
|
||||
|
||||
Texture::Texture(Texture&& other) noexcept {
|
||||
if (m_textureId != 0)
|
||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||
|
||||
m_textureId = other.m_textureId;
|
||||
m_width = other.m_width;
|
||||
m_height = other.m_height;
|
||||
|
|
@ -271,8 +268,10 @@ namespace ImGuiExt {
|
|||
}
|
||||
|
||||
Texture& Texture::operator=(Texture&& other) noexcept {
|
||||
if (m_textureId != 0)
|
||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||
if (this == &other)
|
||||
return *this;
|
||||
|
||||
this->reset();
|
||||
|
||||
m_textureId = other.m_textureId;
|
||||
m_width = other.m_width;
|
||||
|
|
@ -288,8 +287,10 @@ namespace ImGuiExt {
|
|||
}
|
||||
|
||||
void Texture::reset() {
|
||||
#if !defined(OS_WEB)
|
||||
if (glDeleteTextures == nullptr)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (m_textureId != 0) {
|
||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||
|
|
|
|||
Loading…
Reference in New Issue