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. Crash in QVariantMap/QVariantList destructor
Qt 6.11 is out! See what's new in the release blog

Crash in QVariantMap/QVariantList destructor

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 6.5k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hallo folks,

    I recently built up a structure using QVariantMaps and QVariantLists to convert it to JSON afterwards.
    But I experienced a strange behaviour when leaving the function and the destructor of this structure has been called.

    It looked like this:
    @QVariantMap outerMap;
    QVariantList outerList;
    QVariantMap innerMap;
    QVariantList innerList;

    innerList.append("foo");
    innerMap.insert("test", innerList);
    outerList.append(innerMap);
    outerMap.insert("test1", outerList);@

    If I replace the innerList with another QVariantMap or anything else, it workes fine. Is this a problem on my side or is this a bug in Qt? I also tried to clear all QVariantMaps and QVariantLists myself starting from the inner to outer before I delete them, but the same problems comes up..

    Any ideas? ;)

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      I cannot reproduce a crash. Can you provide us a complete test case please?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Hmm,

        I am using VisualStudio to compile my project and to reproduce the crash.
        If I try the same in QtCreator, everything works fine.
        Both are using Qt 4.6, what could be the difference?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Is QtCreator using MSVC too - or is it using the MinGW toolchain?

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            It is using MSVC++ Toolchain.
            The only difference in the build process is that QtCreator uses JOM and MSVC is configured to use JAM, dont know if this matters.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Are you linking with the right version of the Qt libs then? Just checking... I have no idea what else it might be.

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                I am not quite sure..
                I told JAM where to find the Qt libs for MSVC and always use the debug libs.
                How can I check if the linked libs are correct?

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Mixing wrong DLLs can lead to that effect.

                  The "Dependency Walker":http://www.dependencywalker.com/ shows you the loaded (or missing) DLLs. Be aware, that it shows different results than using it from within the IDE, as the latter may have manipulated the search PATH.

                  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