Solved Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported?
-
hi,all
Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported? -
@canid said in Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported?:
Why is the APPCRASH error reported?
Because the app seems to crash. Show use your minimal, compilable code where this happens. I'm pretty sure it's an error in your code. Or use a debugger to see where it crashes.
-
@Christian-Ehrlicher
I click the button to call QApplication:: exit (0). The program exits, and then an APPCRASH error is reported. There is no other operation in the button slot function. The program has no error in Windows 10 -
@canid
I would suspect it's not necessarily the act of clicking the button and doing the exit that is the cause, it's the state the application is already in due to some previous actions you have taken which then shows up during program exit. For example, quite a bit of deletion is going on during program exit, things like duplicate-deletion show up.As @Christian-Ehrlicher says, you really ought run under debugger and see what stack trace tells you.
-
@JonB
I simplify the project to this way (dlg_test is a new empty form class). When debugging, clicking the button will still report an error, but the same code for a new project will not. It's very puzzling.main.cpp ------------------------------- #include <QApplication> #include <mod_window/dlg_test.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); dlg_test dlg; if (dlg.exec()==QDialog::Accepted) { }else{ return 0; } return app.exec(); } dlg_test.cpp ------------------------------- dlg_test::dlg_test(QWidget *parent) :QDialog(parent),ui(new Ui::dlg_test) { ui->setupUi(this); } dlg_test::~dlg_test() { delete ui; } void dlg_test::on_pushButton_clicked() { reject(); }
-
So does the above code crash? If so what's the backtrace / where exactly does it crash?
-
@Christian-Ehrlicher
I enabled breakpoint debugging in the main function, but the debugger jumped to the assembly code, unable to locate the problem directly -
I want to see the backtrace...
-
@Christian-Ehrlicher
Do you mean this?
-
Ok, see for example here: https://bugreports.qt.io/browse/QTBUG-75815
Make sure that the correct openssl libraries are used. E.g. with the help of Dependency Walker.
-
@Christian-Ehrlicher
From which window can I get this information? -
@canid said in Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported?:
From which window can I get this information?
Dependency Walker is an extra tool available in the net. And searching for openssl libs can be done with the explorer. The PATH can als be inspected with Windows tools.