PDA

View Full Version : setPixmap cause assertion?



Equilibrium
11th October 2007, 16:31
Hi all,

I have a QDialog derived class and in the constructor i load pixmap onto a QLabel


QPixmap lqpm;
sLcgsDir.sprintf("%s\\UI\\Images",getenv("IGTS_DATA_FOLDER_PATH"));
lqpm.load(sLcgsDir+"\\welcome_IGTS.jpg");
mainPixmapLabel->setPixmap(lqpm);


this dialog is the mainwidget of the application , and when i close it to exit the application i get into an assertion in dbgDel.cpp on this line



_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));


if i comment the load , or load an empty Pixmap the assertion does not happen.

Can you please assist?

I use QT 3.3.5 On WinXP

Thanks
Yariv

jacek
11th October 2007, 17:38
What is the value of sLcgsDir when you get that assertion? What does QPixmap::load() return?

Could you post the backtrace?

Equilibrium
15th October 2007, 08:24
I get the assertion when exiting the application


HEAP[CPDM.exe]: Invalid Address specified to RtlValidateHeap( 02E70000, 02FD9108 )
Unhandled exception at 0x7c901230 in CPDM.exe: User breakpoint.
First-chance exception at 0x1020a752 (msvcr71d.dll) in CPDM.exe: 0xC0000005: Access violation reading location 0x05fa92b0.
Unhandled exception at 0x1020a752 (msvcr71d.dll) in CPDM.exe: 0xC0000005: Access violation reading location 0x05fa92b0.

the value of sLcgsDir is a valid path , QPixmap::load() returns true , the pixmap displays ok
The problem is when exititing the application there is an assertion.

If i remark the QPixmap::load() command or load an empty pixmap , i don't recive this assertion on exit

jacek
23rd October 2007, 00:34
The backtrace is too short to judge anything from it. Perhaps you should compile your application in debug mode and try again to get more info?

Either you destruct something twice or corrupt the heap in some way, or there's some problem in the way Qt handles that image. Does it crash when you load some other image?