You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i found a bug. When creating CCDictionary from JSON object we use autorelease object. And when parameters pass to Native equriment we get empty dictionary. So i added retatin when create CCDIctionary and release in every to_be_call function.
CCObject* NDKHelper::GetCCObjectFromJson(json_t *obj)
{
if (obj == NULL)
return NULL;
if (json_is_object(obj))
{
CCDictionary *dictionary = CCDictionary::create();
dictionary->retain();
.....
Log displayed issue:
{"calling_method_name":"getCoins","calling_method_params":{"coins":"0","gems":"0"}}
Ndk proceed key coins
Ndk proceed key gems
Ndk get dictionary with 2 keys
getCoins call
params count 0 //so we have empty dictionary
NULL string
NULL string
The text was updated successfully, but these errors were encountered:
First of all thanks for the bug report. I think if i will retain the
dictionary in the method, i will have a non released or an orphan pointer
hanging around. What i can do is, i can release the pointer outside my
function where i actually make the call, but again there would be
consistency issues in here. I will think of solving this bug in some other
way from which i can release the memory too after the use. I will let you
know.
Thanks once again for helping me out with the solution i made.
I have tried to resolve the bug of having null as dictionary. Can you please check it and tell me if its now giving you the correct value or not ? Thanks.
Hi, i found a bug. When creating CCDictionary from JSON object we use autorelease object. And when parameters pass to Native equriment we get empty dictionary. So i added retatin when create CCDIctionary and release in every to_be_call function.
CCObject* NDKHelper::GetCCObjectFromJson(json_t *obj)
{
if (obj == NULL)
return NULL;
.....
Log displayed issue:
{"calling_method_name":"getCoins","calling_method_params":{"coins":"0","gems":"0"}}
Ndk proceed key coins
Ndk proceed key gems
Ndk get dictionary with 2 keys
getCoins call
params count 0 //so we have empty dictionary
NULL string
NULL string
The text was updated successfully, but these errors were encountered: