JS: <no filename="filename">:0:too much recursion

Hi,

I’m experiencing the same issue but i think the context is different and I don’t know what I can do.

I have an android application with 2 activities A and B

A is a home app with menu, preference, etc and it’s in android native ui

B is a cocos2dx-js activity and this is launch from the activity A.

In the ui thread of B there is an android ui button that allow to switch back to A to change some preferences before coming back to B.

When the application switch between activities : A -> B -> A -> B, the cocos2d-x context seems the same but i’ve got the “too much recursion” issue.

Any ideas to solve this ?
note:use cocos2dx-js version 3.14.1

I think the reason is A is running in UI thread and it’s forbidden to interact with Spidermonkey context which is running in GL thread

Please schedule all JS function calls into the GL Thread:

Director->getInstance()->getScheduler()->performFunctionInCocosThread(...)