Debugging resource loss



  • After running my Qt program for a bit, I get the following fatal error:

    @Critical: QFontEngine::loadEngine: CreateFontIndirect failed ()
    Critical: QFontEngine::loadEngine: CreateFontIndirect failed ()
    Critical: QFontEngine::loadEngine: CreateFontIndirect failed ()
    Fatal: ASSERT: "hdc" in file c:\ndk_buildrepos\qt-desktop\src\gui\image\qnativeimage.cpp, line 110
    @

    The working part of the program creates a lot of QPixmaps from QImages, perhaps 20-30 / second, as I display a full frame video stream:

    @void VideoWidget::DoUpdate()
    {
    if ( vpix && !image_changing_ )
    { // okay, repaint
    vpix->convertFromImage(*videoImage);
    ui->imageLabel->setPixmap(*vpix);
    }
    }
    @
    I'm not sure if that is connected. I imagine it is some kind of resource leak, but I'm not sure where to begin debugging and/or measuring this. As it takes a good 20-40 minutes to (reliably) reproduce, it's a real drag on my productivity!



  • Just a FYI - turns out it was actually in a DLL that was leaking an HDC every call. I gradually narrowed this down using Process Explorer, commenting out calls as the GDI Handles went up rapidly. As I commented out calls. if I saw the GDI Handles stay stable, I went deeper and finally found it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.