[apps/code] Fix Python loading when going in the VarBoxController

The Var box controller deinited python on exit, and the console
controller did not reload python + it made the console controller lose
all its context, such as imported scripts
This commit is contained in:
Léa Saviot
2018-09-21 11:53:53 +02:00
parent 47e78a79fa
commit 2661032993
7 changed files with 25 additions and 25 deletions

View File

@@ -49,11 +49,11 @@ const char * VariableBoxController::ContentViewController::title() {
}
void VariableBoxController::ContentViewController::didEnterResponderChain(Responder * previousFirstResponder) {
m_pythonDelegate->initPythonWithUser(this);
}
void VariableBoxController::ContentViewController::willExitResponderChain(Responder * nextFirstResponder) {
m_pythonDelegate->deinitPython();
/* This Code::VariableBoxController should always be called from an
* environment where Python has already been inited. This way, we do not
* deinit Python when leaving the VariableBoxController, so we do not lose the
* environment that was loaded when entering the VariableBoxController. */
assert(m_pythonDelegate->pythonIsInited());
}
void VariableBoxController::ContentViewController::viewWillAppear() {