Results 1 to 6 of 6

Thread: Debug Assertion Failed

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Debug Assertion Failed

    Hi,

    I'm developing an application using Qt 4.3.0 and Visual Studio .NET 2003.

    Anyone knows what is an "Debug Assertion Failed"?


    Thanks,
    Attached Images Attached Images
    Òscar Llarch i Galán

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Debug Assertion Failed

    It could be for example that you delete something twice. May we see the call stack (Debug->Windows->Call Stack)?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Debug Assertion Failed

    Hi,

    I've found that I'm deleting a char pointer that is already deleted. Two objects have the same pointer and one deletes the data so the second one try to delete it and crash.

    Is there anyway to know if the data is deleted?

    Thanks,
    Òscar Llarch i Galán

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Debug Assertion Failed

    Quote Originally Posted by ^NyAw^ View Post
    Is there anyway to know if the data is deleted?
    The common approach is to nullify pointers after delete.
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Debug Assertion Failed

    Hi,

    The common approach is to nullify pointers after delete.
    Yes, I do it in the first object that deletes the data, but the second object is pointing to the erased data. I only want to know if there is a way to do it without having to tell the other object to point it to null.

    I will try another approach.

    Thanks,
    Òscar Llarch i Galán

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Debug Assertion Failed

    I'd say it's a question of design. This is what happens when dynamically allocated memory has no clear ownership.
    J-P Nurmi

Similar Threads

  1. Deploying debug Qt application - failed to load ODBC driver
    By sureshbabu in forum Installation and Deployment
    Replies: 1
    Last Post: 1st November 2007, 13:35
  2. What is debug mode for without MSVC?
    By firegun9 in forum Newbie
    Replies: 1
    Last Post: 5th September 2007, 18:21
  3. Qt4 open src mingw from a PC to another
    By nvictor in forum Installation and Deployment
    Replies: 11
    Last Post: 1st May 2007, 18:41
  4. Adding custom defines when on debug build
    By chus in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2007, 12:38
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 14:15

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.