C++ code with poco json crashes after method ends

I have this very simple C++ method that uses poco json for querying a json string. Apparently it crashes after the method ends. The details of the crash are after my source code

void SomeClass::processJson(std::shared_ptr<Foo> code,std::string& json) {     try     {         std::string json_str = json;         Parser parser;         Var result;          ParseHandler handler;         parser.setHandler(&handler);         parser.parse(json_str);         result = handler.asVar();          Query query(result);         Poco::JSON::Array::Ptr arr= query.findArray("result.payload.infos");          int t = arr->size();      } catch (...)     {      } } 

Now as soon as the method ends i get a crash indicating this code in the stack trace in Var.h of POCO

#ifdef POCO_NO_SOO      VarHolder* content() const     {         return _pHolder;     }      void destruct()     {         if (!isEmpty()) delete content();     }      VarHolder* _pHolder;  #else 

A copy of the stack trace after this method is below

C++ code with poco json crashes after method ends


Category: json Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.201 (s). 12 q(s)