]> git.tdb.fi Git - libs/gl.git/commitdiff
Add missing destructor to OpenGLSampler
authorMikko Rasa <tdb@tdb.fi>
Sat, 13 Nov 2021 14:14:23 +0000 (16:14 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 13 Nov 2021 14:26:46 +0000 (16:26 +0200)
source/backends/opengl/sampler_backend.cpp
source/backends/opengl/sampler_backend.h

index 85d278d3a1a1da75d4d098ea1aeb6457a5ae18c1..be3f67cbc37ae688bbf5cd776ae8642c1e11a40c 100644 (file)
@@ -25,6 +25,12 @@ OpenGLSampler::OpenGLSampler()
                glGenSamplers(1, &id);
 }
 
+OpenGLSampler::~OpenGLSampler()
+{
+       if(id)
+               glDeleteSamplers(1, &id);
+}
+
 bool OpenGLSampler::check_anisotropic(bool require)
 {
        if(require)
index 20ad4b6c262a252683ba38fb1aa3f682b71264b0..2f644431c39983894d00207cd8b10e2ca4ede1e4 100644 (file)
@@ -12,6 +12,7 @@ protected:
        unsigned id = 0;
 
        OpenGLSampler();
+       ~OpenGLSampler();
 
        static bool check_anisotropic(bool);