mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user