Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported?
Forum Updated to NodeBB v4.3 + New Features

Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported?

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 3 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    canid
    wrote on last edited by canid
    #1

    hi,all
    Under windows7, call QApplication::exit(0) to exit the program. Why is the APPCRASH error reported?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      C 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        @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.

        C Offline
        C Offline
        canid
        wrote on last edited by canid
        #3

        @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

        JonBJ 1 Reply Last reply
        0
        • C canid

          @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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @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.

          C 1 Reply Last reply
          3
          • JonBJ JonB

            @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.

            C Offline
            C Offline
            canid
            wrote on last edited by canid
            #5

            @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();
            }
            

            捕获.JPG

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              So does the above code crash? If so what's the backtrace / where exactly does it crash?

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              C 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                So does the above code crash? If so what's the backtrace / where exactly does it crash?

                C Offline
                C Offline
                canid
                wrote on last edited by canid
                #7

                @Christian-Ehrlicher
                I enabled breakpoint debugging in the main function, but the debugger jumped to the assembly code, unable to locate the problem directly

                1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  I want to see the backtrace...

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  C 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    I want to see the backtrace...

                    C Offline
                    C Offline
                    canid
                    wrote on last edited by
                    #9

                    @Christian-Ehrlicher
                    Do you mean this?
                    捕获3.JPG

                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Online
                      Christian EhrlicherC Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      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.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      C 1 Reply Last reply
                      3
                      • Christian EhrlicherC Christian Ehrlicher

                        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.

                        C Offline
                        C Offline
                        canid
                        wrote on last edited by
                        #11

                        @Christian-Ehrlicher
                        From which window can I get this information?

                        1 Reply Last reply
                        0
                        • Christian EhrlicherC Online
                          Christian EhrlicherC Online
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @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.

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          1

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved