[Interest] QGLContext::makeCurrent(): Failed. Why?
Guido Seifert
Wargand at gmx.de
Tue Jan 22 00:02:42 CET 2013
> You should clean up your textures BEFORE calling toImage().
Does not make any difference if I clean up before or after. It is interesting and annoying that there is a warning I don't understand, but I suppose I can ignore this problem for the moment.
I create a QGLPixelBuffer on the heap:
QGLPixelBuffer *buffer =
new QGLPixelBuffer(mStartImage.width(),mStartImage.height());
Add some textures:
mStartImageTexture = buffer->bindTexture(mStartImage,GL_TEXTURE_2D);
Do some OpenGL stuff, get the image, and last delete the buffer:
delete(buffer);
So if I am not missing vital information, e.g. that the OpenGL libs do something funny, I suppose I won't have a memory leak even if I do not delete the textures explicitly. At least it does not look like I have one and the docs say:
QGLPixelBuffer::~QGLPixelBuffer ()
Destroys the pbuffer and frees any allocated resources.
Guido
More information about the Interest
mailing list