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. When closing application Exception Triggered.
Forum Updated to NodeBB v4.3 + New Features

When closing application Exception Triggered.

Scheduled Pinned Locked Moved Unsolved General and Desktop
24 Posts 5 Posters 2.0k Views 2 Watching
  • 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.
  • mrjjM mrjj

    @SPlatten
    Hi
    ok. and you not having any members of QObject base in the class ?
    I mean as non pointer in MainWindow.
    Its sometimes possible to get double deletes that way.

    SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #11

    @mrjj , at the moment the application is in very early stages for the MainWindow class contains just:

    DataSets* mpDataSetsDlg;
    Ui::MainWindow* mpui;
    

    In the constructor:

    MainWindow::MainWindow(QWidget* pParent) : QMainWindow(pParent),
                                               mpDataSetsDlg(nullptr),
                                               mpui(new Ui:MainWindow)
    {
        mpui->setupUi(this);
        connect(mpui->btnDataSets, &QPushButton->clicked,
                this, &MainWindow::dataSetsBtnClicked);
    }    
    

    In the destructor:

    void MainWindow::~MainWindow()
    {
        if ( mpDataSetsDlg != nullptr )
        {
            delete mpDataSetsDlg;
            mpDataSetsDlg = nullptr;
        }
        delete mpui;
        mpui = nullptr;
    }
    

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • SPlattenS SPlatten

      @mrjj , I've just commented out everything in the MainWindow destructor, recompiled and run and its still doing the same.

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

      @SPlatten
      Remove all your #includes, other than what is required to get a minimal Qt program open a main window. It should be 10 lines long. No Trainer object No Trainer include files. Does it work?

      If your program only crashes with Trainer and its include files, I still don't understand what we can say since we don't even know what it is.

      SPlattenS 1 Reply Last reply
      0
      • JonBJ JonB

        @SPlatten
        Remove all your #includes, other than what is required to get a minimal Qt program open a main window. It should be 10 lines long. No Trainer object No Trainer include files. Does it work?

        If your program only crashes with Trainer and its include files, I still don't understand what we can say since we don't even know what it is.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #13

        @JonB , I modified main.cpp to:

        #include <QApplication> //Add this
        #include "main window.h"
        //#include "trainer.h"
        
        int main(int argc, char* argv[])
        {
            //Trainer trainer(argc, argv);
            QApplication a(argc, argv);
            MainWindow w;
            w.show();
            return a.exec();
            //return trainer.exec();
        }
        

        Rebuilt and it does exactly the same, crash location is in exactly the same place.

        Kind Regards,
        Sy

        J.HilkJ JonBJ 2 Replies Last reply
        0
        • SPlattenS SPlatten

          @JonB , I modified main.cpp to:

          #include <QApplication> //Add this
          #include "main window.h"
          //#include "trainer.h"
          
          int main(int argc, char* argv[])
          {
              //Trainer trainer(argc, argv);
              QApplication a(argc, argv);
              MainWindow w;
              w.show();
              return a.exec();
              //return trainer.exec();
          }
          

          Rebuilt and it does exactly the same, crash location is in exactly the same place.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #14

          @SPlatten well, in the stack trace, what's the first entry, thats from your code ?

          you know that you can step back, when you're in assembler code right?


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          SPlattenS 1 Reply Last reply
          0
          • SPlattenS SPlatten

            @JonB , I modified main.cpp to:

            #include <QApplication> //Add this
            #include "main window.h"
            //#include "trainer.h"
            
            int main(int argc, char* argv[])
            {
                //Trainer trainer(argc, argv);
                QApplication a(argc, argv);
                MainWindow w;
                w.show();
                return a.exec();
                //return trainer.exec();
            }
            

            Rebuilt and it does exactly the same, crash location is in exactly the same place.

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

            @SPlatten
            Remove #include "main window.h" and replace MainWindow w; by QMainWindow w; (with presumably #include <QMainWindow>).

            If that does not work, since it is the minimal Qt application what has changed for you since you last successfully built/ran any Qt GUI program?

            SPlattenS 1 Reply Last reply
            0
            • JonBJ JonB

              @SPlatten
              Remove #include "main window.h" and replace MainWindow w; by QMainWindow w; (with presumably #include <QMainWindow>).

              If that does not work, since it is the minimal Qt application what has changed for you since you last successfully built/ran any Qt GUI program?

              SPlattenS Offline
              SPlattenS Offline
              SPlatten
              wrote on last edited by
              #16

              @JonB , to be honest, it could be the build of the laptop, its an older version of Qt:

              Qt Creator 4.4.1
              Based on Qt 5.9.2 (MSVC 2015, 32 bit)
              

              I have no control over the laptop or the version of Qt being used, this is supplied by the company I am contracted to.

              Kind Regards,
              Sy

              1 Reply Last reply
              0
              • J.HilkJ J.Hilk

                @SPlatten well, in the stack trace, what's the first entry, thats from your code ?

                you know that you can step back, when you're in assembler code right?

                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on last edited by
                #17

                @J-Hilk , I've expanded the stack trace and there is no call the traces back to my source, the first call is in Function: RtlGetAppContainerNamedObjectPath, File: ntdll

                Kind Regards,
                Sy

                J.HilkJ 1 Reply Last reply
                0
                • SPlattenS SPlatten

                  @J-Hilk , I've expanded the stack trace and there is no call the traces back to my source, the first call is in Function: RtlGetAppContainerNamedObjectPath, File: ntdll

                  J.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #18

                  @SPlatten thats unfortunate

                  since this is a basic and small project so far, can you share, the minimal example ?

                  that means probably only your custom MainWindow, so we can check ourselves, and check it against different Qt versions as well


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  JonBJ SPlattenS 2 Replies Last reply
                  0
                  • J.HilkJ J.Hilk

                    @SPlatten thats unfortunate

                    since this is a basic and small project so far, can you share, the minimal example ?

                    that means probably only your custom MainWindow, so we can check ourselves, and check it against different Qt versions as well

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

                    @J-Hilk
                    That is why I suggested @SPlatten should use QMainWindow, not his own MainWindow, to test. If that still does not work (I'm not sure if he has answered that), then something is fundamentally with his Qt/environment. I would do that before examining anything about a custom MainWindow or header file.

                    1 Reply Last reply
                    0
                    • J.HilkJ J.Hilk

                      @SPlatten thats unfortunate

                      since this is a basic and small project so far, can you share, the minimal example ?

                      that means probably only your custom MainWindow, so we can check ourselves, and check it against different Qt versions as well

                      SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by
                      #20

                      @J-Hilk , in doing this, I decided to go one better. I did the following in Qt Creator:

                      1. Clicked on File top line menu
                      2. Selected New File or Project...
                      3. Selected Application and Qt Widgets Application
                      4. Clicked on the Choose... button
                      5. Entered test into Name: text box and clicked the Next button
                      6. Checked only Desktop Qt 5.9.2 MSVC2015 32bit in Kit Selection
                      7. Clicked Next button
                      8. Clicked Next button
                      9. Clicked Finish button
                      10. Right clicked project and selected Rebuild
                      11. Run application in debug mode and clicked the close widget in the MainWindow

                      Same thing happens, application stops and Exception Triggered dialog is displayed.

                      Kind Regards,
                      Sy

                      JoeCFDJ 1 Reply Last reply
                      0
                      • SPlattenS SPlatten

                        @J-Hilk , in doing this, I decided to go one better. I did the following in Qt Creator:

                        1. Clicked on File top line menu
                        2. Selected New File or Project...
                        3. Selected Application and Qt Widgets Application
                        4. Clicked on the Choose... button
                        5. Entered test into Name: text box and clicked the Next button
                        6. Checked only Desktop Qt 5.9.2 MSVC2015 32bit in Kit Selection
                        7. Clicked Next button
                        8. Clicked Next button
                        9. Clicked Finish button
                        10. Right clicked project and selected Rebuild
                        11. Run application in debug mode and clicked the close widget in the MainWindow

                        Same thing happens, application stops and Exception Triggered dialog is displayed.

                        JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by
                        #21

                        @SPlatten Is it a 32bit bug? Try to make a 64bit build to see if you have the same problem.

                        SPlattenS 1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          @SPlatten Is it a 32bit bug? Try to make a 64bit build to see if you have the same problem.

                          SPlattenS Offline
                          SPlattenS Offline
                          SPlatten
                          wrote on last edited by
                          #22

                          @JoeCFD , thank you, thats a shame, the problem is the target is 32 bit so regardless of if it works in 64 bit, thats not an option.

                          Kind Regards,
                          Sy

                          JoeCFDJ 1 Reply Last reply
                          0
                          • SPlattenS SPlatten

                            @JoeCFD , thank you, thats a shame, the problem is the target is 32 bit so regardless of if it works in 64 bit, thats not an option.

                            JoeCFDJ Offline
                            JoeCFDJ Offline
                            JoeCFD
                            wrote on last edited by JoeCFD
                            #23

                            @SPlatten That is unlucky. Install a 32 bit debug build of Qt 5.9.2 and debug into qt code to see the cause.

                            SPlattenS 1 Reply Last reply
                            0
                            • JoeCFDJ JoeCFD

                              @SPlatten That is unlucky. Install a 32 bit debug build of Qt 5.9.2 and debug into qt code to see the cause.

                              SPlattenS Offline
                              SPlattenS Offline
                              SPlatten
                              wrote on last edited by
                              #24

                              @JoeCFD , sorry I just don't have the time.

                              Kind Regards,
                              Sy

                              1 Reply Last reply
                              0

                              • Login

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