Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
Description
http://qt-project.org/doc/qt-5.0/gettingstartedqt.html
If you take the second example and fix the includes for qt5 then it will crash on exit as below:
Program received signal SIGABRT, Aborted.
0x00007ffff5642d95 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff5642d95 in raise () from /lib64/libc.so.6
#1 0x00007ffff56442ab in abort () from /lib64/libc.so.6
#2 0x00007ffff567cece in __libc_message () from /lib64/libc.so.6
#3 0x00007ffff5682c06 in malloc_printerr () from /lib64/libc.so.6
#4 0x00007ffff7564ee0 in QVBoxLayout::~QVBoxLayout (this=0x7fffffffdb90, __in_chrg=<optimized out>) at kernel/qboxlayout.cpp:1345
#5 0x00007ffff758632c in QWidget::~QWidget (this=0x7fffffffdb60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1404
#6 0x0000000000401164 in main (argv=1, args=0x7fffffffdd08) at main.cpp:19
(gdb) fr 5
#5 0x00007ffff758632c in QWidget::~QWidget (this=0x7fffffffdb60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1404
1404 delete d->layout;
The problem is that the layout is deleted but it was allocated on the stack. The same issue can be reproduced under 4.7.4.