Crashes if close MainWindow
-
Having a loop, open MainWindow window, if close window with x button getting programm crashed
qtc.process_stub: Inferior error: QProcess::Crashed "Process crashed"
Press <RETURN> to close this window...How to safe open and close main window?
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { secDialog = new SecDialog (this); secDialog -> show(); }
-
If it crashes use a debugger to see where exactly it crashes. Then show us the code and we can say maybe more.
@Christian-Ehrlicher it was problem in destructor, solved
thanks :) -
Not sure if this will work, but:
MainWindow::~MainWindow() { secDialog -> hide(); delete secDialog; delete ui; }
-
Not sure if this will work, but:
MainWindow::~MainWindow() { secDialog -> hide(); delete secDialog; delete ui; }
@johngod does not help
how to get to main loop? exit MainWindow maturely
-
@johngod does not help
how to get to main loop? exit MainWindow maturely
If it crashes use a debugger to see where exactly it crashes. Then show us the code and we can say maybe more.
-
If it crashes use a debugger to see where exactly it crashes. Then show us the code and we can say maybe more.
@Christian-Ehrlicher it was problem in destructor, solved
thanks :) -
-
Crashes on exit are common if you do not have the parent-child hierarchy set up correctly.