Open KirillBarkousky opened 11 years ago
Hey KirillBarkousky,
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.
Thanks.
Amir Ali Jiwani CTO Pi Labs - http://pilabs.com
Hey Kirill,
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