delete texture and framebuffer after export
This commit is contained in:
parent
3656b02237
commit
e864043e76
|
@ -350,7 +350,8 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||
w,h = map(int, size)
|
||||
|
||||
self.makeCurrent()
|
||||
|
||||
tex = None
|
||||
fb = None
|
||||
try:
|
||||
output = np.empty((w, h, 4), dtype=np.ubyte)
|
||||
fb = glfbo.glGenFramebuffers(1)
|
||||
|
@ -392,6 +393,10 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||
self.opts['viewport'] = None
|
||||
glfbo.glBindFramebuffer(glfbo.GL_FRAMEBUFFER, 0)
|
||||
glBindTexture(GL_TEXTURE_2D, 0)
|
||||
if tex is not None:
|
||||
glDeleteTextures([tex])
|
||||
if fb is not None:
|
||||
glfbo.glDeleteFramebuffers([fb])
|
||||
|
||||
return output
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user