Results 1 to 2 of 2

Thread: QMap destructor got CRT detected message

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QMap destructor got CRT detected message

    Iam getting CRT Heap corruption detected message, when running the following simple c++ code. The error comes from ::free method called by QMap destrcutor.

    Qt Code:
    1. void foo() {
    2. QMap<QString, QVariant> map;
    3. map["Sample1"] = 2;
    4. map["Sample2"] = 3;
    5. }
    To copy to clipboard, switch view to plain text mode 
    I am using Qt 5.5.1 (It built Qt with Visual Studio 2013 and configure it to target windows xp(using v120_xp toolset)).

    Preconditions:

    My operating system is Windows 8 64 bit.
    I changed the Platform Tools property to Visual Studio 2013 - Windows XP (v120_xp).
    When I change the code to following, the error is gone.

    Qt Code:
    1. void foo() {
    2. QMap<QString, int> map; // Change the second type from QVariant to int
    3. map["Sample1"] = 2;
    4. map["Sample2"] = 3;
    5. }
    To copy to clipboard, switch view to plain text mode 
    Any help will be appreciated.


    Stacktrace contains following lines:
    Qt Code:
    1. msvcr120d.dll!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1376 C++
    2. msvcr120d.dll!_free_dbg(void * pUserData, int nBlockUse) Line 1265 C++
    3. msvcr120d.dll!free(void * pUserData) Line 49 C++
    4. Qt5Cored.dll!qMapDeallocate(QMapNodeBase * node, int alignment) Line 318 C++
    5. Qt5Cored.dll!QMapDataBase::freeTree(QMapNodeBase * root, int alignment) Line 349 C++
    6. Qt5Cored.dll!QMapDataBase::freeTree(QMapNodeBase * root, int alignment) Line 349 C++
    7. Armaghan.exe!QMapData<QString,QVariant>::destroy() Line 225 C++
    8. Armaghan.exe!QMap<QString,QVariant>::~QMap<QString,QVariant>() Line 339 C++
    9. Armaghan.exe!foo() Line 32 C++
    10. Armaghan.exe!main(int argc, char * * argv) Line 37 C++
    11. [External Code]
    To copy to clipboard, switch view to plain text mode 
    Last edited by hosseinzolfi; 7th February 2017 at 08:14.

Similar Threads

  1. No version of QT detected
    By psykomusic in forum Newbie
    Replies: 7
    Last Post: 12th April 2016, 16:03
  2. QMap value type with virtual destructor
    By Vikram.Saralaya in forum Qt Programming
    Replies: 3
    Last Post: 25th November 2015, 10:23
  3. No mouseButtonRelease detected
    By maitrezeta in forum Qt Programming
    Replies: 4
    Last Post: 3rd September 2010, 15:23
  4. glibc detected
    By raghvendramisra in forum Qt Programming
    Replies: 5
    Last Post: 28th May 2008, 03:29
  5. QMap destructor bug
    By Ruud in forum Qt Programming
    Replies: 6
    Last Post: 8th April 2006, 09:08

Tags for this Thread

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.