August 23, 2011

Angel0fDarkness Angel0fDarkn..
Lab Rat
6 posts

Crash in QVariantMap/QVariantList destructor

 

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:

  1. QVariantMap outerMap;
  2. QVariantList outerList;
  3. QVariantMap innerMap;
  4. QVariantList innerList;
  5.  
  6. innerList.append("foo");
  7. innerMap.insert("test", innerList);
  8. outerList.append(innerMap);
  9. 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? ;)

7 replies

August 24, 2011

Volker Volker
Ant Farmer
5428 posts

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

August 24, 2011

Angel0fDarkness Angel0fDarkn..
Lab Rat
6 posts

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?

August 24, 2011

Lukas Geyer Lukas Geyer
Lab Rat
2074 posts

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

August 24, 2011

Angel0fDarkness Angel0fDarkn..
Lab Rat
6 posts

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.

August 24, 2011

Andre Andre
Robot Herder
6295 posts

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

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

August 24, 2011

Angel0fDarkness Angel0fDarkn..
Lab Rat
6 posts

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?

August 24, 2011

Volker Volker
Ant Farmer
5428 posts

Mixing wrong DLLs can lead to that effect.

The Dependency Walker [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.

 
  ‹‹ sending a signal to my mainwindow      [Solved] Two different orientations in one print ››

You must log in to post a reply. Not a member yet? Register here!