Results 1 to 2 of 2

Thread: Program crashes on OS X Lion

  1. #1
    Join Date
    Oct 2011
    Location
    Turkey
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Program crashes on OS X Lion

    I use Qt 4.8 rc on os x lion. I just create an empty gui app base on QMainWindow. There is only one line code that i typed in MainWindow constructor: setAtribute(Qt::WA_DeleteOnClose); and because of this line program crashes on exit. Here is Application Output says this:
    Qt Code:
    1. MainWindow(2770,0x7fff78a08960) malloc: *** error for object 0x7fff5fbffbe8: pointer being freed was not allocated
    2. *** set a breakpoint in malloc_error_break to debug
    3. The program has unexpectedly finished.
    4. /Users/fyodor/Documents/Programlama/Qt/WorkSpace/MainWindow/MainWindow.app/Contents/MacOS/MainWindow exited with code 0
    To copy to clipboard, switch view to plain text mode 
    Is this a bug on OS X and what benefits do we get when we use it ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Program crashes on OS X Lion

    If you allocated the QMainWindow on the stack (as is usually the case) then there is no heap allocated memory to delete and you have asked Qt to do exactly that.

Similar Threads

  1. Program crashes
    By Fallen_ in forum Qt Programming
    Replies: 49
    Last Post: 20th September 2010, 01:41
  2. Program crashes while trying to do a check in constructor
    By hakermania in forum Qt Programming
    Replies: 5
    Last Post: 1st September 2010, 10:15
  3. qstringlist array crashes program
    By chrisb123 in forum Newbie
    Replies: 4
    Last Post: 23rd October 2009, 15:03
  4. program crashes (QtTestRunner)
    By fmariusd in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2008, 09:27
  5. Program crashes (SIGSEGV)
    By Voldemort in forum Qt Programming
    Replies: 47
    Last Post: 21st May 2007, 20:09

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.