internalJSONNode _string not initialized

Help
beezler
2011-04-13
2013-06-12
  • beezler

    beezler - 2011-04-13

    I am building libjson with Visual Studio 2010. In JSONOptions.h I have #defined JSON_DEBUG and JSON_ITERATORS, while commenting out JSON_LIBRARY. I have then built a debug version of the library.

    I have built an exe that uses the library. When I try to execute the following code, it crashes deep in STL. Turns out internalJSONNode::Set has unitialized data members. Is there something I need to do to be able to build this in VS 2010?

        JSONNode s = JSONNode(JSON_NODE);
        s.set_name(_T("Outer"));
        json_string tmp(_T("Inner1Value"));
        s.push_back(JSONNode(_T("I1"), tmp));

    Thanks,
    Beezelr

     
  • Jonathan Wallace

    Can you tell me which members are uninitialized?  It shouldn't be possible for _string to be uninitialized, it's an std::string, which initialized automatically to an empty string.  I don't have VS, so I can't test it and it runs fine on GCC.

    Maybe give me a few screengrabs of what the object looks like in the debugger at each step?  That would probably be the most useful.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks