PDA

View Full Version : Program crashes on OS X Lion



fyodor
31st October 2011, 01:47
I use Qt 4.8 rc on os x lion. I just create an empty gui app base on QMainWindow. There is only one line code that i typed in MainWindow constructor: setAtribute(Qt::WA_DeleteOnClose); and because of this line program crashes on exit. Here is Application Output says this:
MainWindow(2770,0x7fff78a08960) malloc: *** error for object 0x7fff5fbffbe8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
The program has unexpectedly finished.
/Users/fyodor/Documents/Programlama/Qt/WorkSpace/MainWindow/MainWindow.app/Contents/MacOS/MainWindow exited with code 0 Is this a bug on OS X and what benefits do we get when we use it ?

ChrisW67
31st October 2011, 06:18
If you allocated the QMainWindow on the stack (as is usually the case) then there is no heap allocated memory to delete and you have asked Qt to do exactly that.