When is onExit() run?

Basically, what I want to know is when is onExit run because I think that is only run when you move to another scene, and what I want is to unload the analytics plugin in a method when the game enter in background or is closed.

I search on the docus, but the only thing that I get is “Reimplemented in ComController, ComAudio, and ComRender.” and that doesn’t tell me nothing about when this method is run.

Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0beta/d9/d7f/classcocos2d_1_1_component.html#ad11ad620f620798fb4cf107a06ed4dba

the onExit() will run when the component been removed…

Ok, and in a scene?

PS Sorry, I put an incorrect link to the onExit that I want beacause I haven’t find the one that I was searching and I think that this one was the one that I want to ask for.