Results 1 to 5 of 5

Thread: Crashing on exiting

  1. #1
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4

    Default Crashing on exiting

    Hey guys,

    I was wondering what might be causing this error I'm having - basically when I put any kind of variable in my class header file it crashes the program when I exit..

    Example:
    My current header file contains
    Qt Code:
    1. #ifndef TIMINGSETTINGS_H
    2. #define TIMINGSETTINGS_H
    3.  
    4. #include <QDialog>
    5.  
    6. namespace Ui {
    7. class TimingSettings;
    8. }
    9.  
    10. class TimingSettings : public QDialog
    11. {
    12. Q_OBJECT
    13.  
    14. public:
    15. explicit TimingSettings(QWidget *parent = 0);
    16. ~TimingSettings();
    17. void AllowClearTimeChange();
    18.  
    19. private:
    20. Ui::TimingSettings *ui;
    21.  
    22. private slots:
    23. void CheckClearTime();
    24. void ChangePurgeTime();
    25. void ChangeReportingTime();
    26. void CheckClearCheckBox();
    27. };
    28.  
    29. #endif // TIMINGSETTINGS_H
    To copy to clipboard, switch view to plain text mode 

    ----------
    It blows up on exiting if I change it like the following (adding the int testVariable):
    Qt Code:
    1. #ifndef TIMINGSETTINGS_H
    2. #define TIMINGSETTINGS_H
    3.  
    4. #include <QDialog>
    5.  
    6. namespace Ui {
    7. class TimingSettings;
    8. }
    9.  
    10. class TimingSettings : public QDialog
    11. {
    12. Q_OBJECT
    13.  
    14. public:
    15. explicit TimingSettings(QWidget *parent = 0);
    16. ~TimingSettings();
    17. void AllowClearTimeChange();
    18. int testVariable;
    19.  
    20. private:
    21. Ui::TimingSettings *ui;
    22.  
    23. private slots:
    24. void CheckClearTime();
    25. void ChangePurgeTime();
    26. void ChangeReportingTime();
    27. void CheckClearCheckBox();
    28. };
    29.  
    30. #endif // TIMINGSETTINGS_H
    To copy to clipboard, switch view to plain text mode 

    Any tips on what might be causing this? I don't do anything with the variable - just the declaration alone causes the crashing..

    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Crashing on exiting

    We can't tell from the header, show the implementation.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Crashing on exiting

    I'd suggest rebuilding the project from scratch. Other than that I agree with high_flyer.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Crashing on exiting

    Improve the question.. Add more codes

  5. #5
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4

    Default Re: Crashing on exiting

    Ahh, rebuilding it fixed it - thanks wysota.

Similar Threads

  1. Crashing without debug mode- No crashing with gdb debugger
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 1
    Last Post: 7th February 2011, 11:27
  2. Qt Creator - Crash when Exiting
    By BrainB0ne in forum Qt Tools
    Replies: 5
    Last Post: 6th May 2009, 21:05
  3. Exiting a Qt Console Application
    By nbetcher in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2009, 21:03
  4. Thread not exiting
    By steg90 in forum Newbie
    Replies: 4
    Last Post: 9th May 2007, 11:31
  5. how to force an exiting?
    By anli in forum Qt Programming
    Replies: 3
    Last Post: 31st July 2006, 12:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.