soomla/cocos2dx-store — pull request #76 by NatWeiss (2014-04-11 18:29:47+00:00)
Title: Fixes crash in JS_NewStringCopyZ

I spent the better part of a day trying to fix a crash in `JS_NewStringCopyZ`. I tried `JS_NewStringCopyN` first but no luck. The crash happened whenever I tried to purchase a product which did not exist on iTunes Connect. A few calls to `callCallback` would be made which all begain with `CCEventHandler::on`. The third time it called `callCallback` it would always crash.

Rather than use `executeFunctionWithOwner`, this proposed change uses `evalString`. It fixes the crash and seems to work more smoothly.

By the way, is `json_delete(root)` necessary here?