if (pBuffer != NULL)
{
Json::Reader* jsonReader = new Json::Reader();
bool isParsingSuccessful = jsonReader->parse( pBuffer, pBuffer+size, m_jsonObj,false );
if ( !isParsingSuccessful )
{
string err = "JSON parsing Error :" + aniFilePath;
CCAssert(0,err.c_str());
}
// sth wrong in NDK free() mechanism, so let it leak on android(BUG).
delete jsonReader;
}
when I used above code, it works fine with iOS SDK, however same code cause crash when it compiled & run with Android NDK.
Error log messages are given below.
06-13 14:21:23.080: A/libc(16726): @@@ ABORTING: INVALID HEAP ADDRESS IN dlfree
06-13 14:21:23.080: A/libc(16726): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
I also tried 0.6.0 rc2, it causes same crash only on android ndk.
I think it might be bug of libc.so in Android NDK, but please let me know if there is any workaround.
Thanks.
Pretty sure this relates to the global
null
Value object, which was a mistake. We applied the Android patch here: https://github.com/open-source-parsers/jsoncpp/