Results 1 to 1 of 1

Thread: QOpenGLTexture error: "Texture has not been destroyed"

  1. #1

    Default Re: QOpenGLTexture error: "Texture has not been destroyed"

    Hi folks! I am using qt 5.4 for an opengl program.
    So far so good, I quite like the new opengl wrap done by the Qt guys.
    Only thing I am having hard time figure out is I keep getting an error when I close my app about the texture here the full error:

    ######
    Requires a valid current OpenGL context.
    Texture has not been destroyed
    ######

    I tried to manually destroy the buffer in the destructor or trying to catch the close event and destroy the texture there but no luck.
    Googling around I found some people flagging a bug report for it but I did not understand if it was accepted or not.
    Anyone had this problem and actually solved it?

    Cheers
    M.


    Added after 17 minutes:


    Actually had this problem for a couple of days and found the answer by myself 3 minutes after posting this,lol, meanwhile I was looking for info about when initializeGL() gets called.
    Anyway if anyone is interested in the answer (which is also in the doc) is that Qt doesn't guarantee that the context is current at clean up time so we must explicitly make that so by calling the makeCurrent() function before doing any clean up. That fixed the error
    Cheers
    Last edited by giordi; 9th April 2015 at 12:23.

Similar Threads

  1. Replies: 3
    Last Post: 27th January 2013, 23:53
  2. Replies: 32
    Last Post: 25th August 2012, 23:10
  3. Replies: 0
    Last Post: 27th February 2010, 17:14
  4. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 11:45
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.