I am trying to create a slightly updated version of the Blanchette - Summerfield "slider - spinbox" example. The updating consists in creating the GUI in the Designer and using the .ui file in my code. The main window is a class MyFrame with a default ctor:
{
ui.setupUi(this);
connect(ui.slider,SIGNAL(valueChanged(int)),ui.spinbox,SLOT(setValue(int)));
connect(ui.spinbox,SIGNAL(valueChanged(int)),ui.slider,SLOT(setValue(int)));
show();
}
MyFrame::MyFrame() : QMainWindow()
{
ui.setupUi(this);
connect(ui.slider,SIGNAL(valueChanged(int)),ui.spinbox,SLOT(setValue(int)));
connect(ui.spinbox,SIGNAL(valueChanged(int)),ui.slider,SLOT(setValue(int)));
show();
}
To copy to clipboard, switch view to plain text mode
The program compiles and runs nicely. When I click the 'x' button on the titlebar, the program closes gracefully sometimes (about 50 % chance) and sometimes produces a crash output:
*** glibc detected *** /home/radek/Desktop/C++/project/slider-release/slider: free(): invalid next size (fast): 0x00000000008a1f90 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x76d76)[0x7f35be0d0d76]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f35be0d5aac]
/home/radek/Desktop/C++/project/slider-release/slider[0x403c57]
/home/radek/Desktop/C++/project/slider-release/slider[0x403a7d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f35be078ead]
/home/radek/Desktop/C++/project/slider-release/slider[0x403ac5]
*** glibc detected *** /home/radek/Desktop/C++/project/slider-release/slider: free(): invalid next size (fast): 0x00000000008a1f90 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x76d76)[0x7f35be0d0d76]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f35be0d5aac]
/home/radek/Desktop/C++/project/slider-release/slider[0x403c57]
/home/radek/Desktop/C++/project/slider-release/slider[0x403a7d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f35be078ead]
/home/radek/Desktop/C++/project/slider-release/slider[0x403ac5]
To copy to clipboard, switch view to plain text mode
but then I get informed that
/home/radek/Desktop/C++/project/slider-release/slider exited with code 0
/home/radek/Desktop/C++/project/slider-release/slider exited with code 0
To copy to clipboard, switch view to plain text mode
I cannot find out any rule, when the program exits normally and when it crashes. Any ideas?
Bookmarks