replaceScene error

I desinged a SceneManager to manage scenes. If i touches menus to switch scenes, it works fine.
My project is based on network.I need to transition scenes by network message, just like event trigger, when network arrives,
and invoke transiton functor to the same scene,it crashed,erros like this:
“child already added. It can’t be added again”.
This problem trubles me many weeks.who can help me to resolve it.Thanks.


networkmsg.bmp.zip (7.9 KB)


SceneManager.bmp.zip (10.1 KB)


logincontrolmenu.JPG (108.0 KB)

are you enqueuing the scene or replacing it? If you use replace it should work even if the scene already exists.

yes,you can view code clips in the annex.

Please don’t invoke engine codes in a new thread.
It is not thread safe.

yes,i considered this, can you give me some suggests on how to receive socket message and transition scenes independent,such as get main UI thread etc.