From 152503a936642fb8f54e1cbcd7130805dd90842b Mon Sep 17 00:00:00 2001 From: xarkes Date: Sun, 25 Mar 2018 13:21:07 +0200 Subject: [PATCH] Segfault fix --- src/utils/JupyterConnection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/JupyterConnection.cpp b/src/utils/JupyterConnection.cpp index 102297d0..c2de55a0 100644 --- a/src/utils/JupyterConnection.cpp +++ b/src/utils/JupyterConnection.cpp @@ -81,7 +81,9 @@ void JupyterConnection::initPython() void JupyterConnection::createCutterJupyterModule() { - PyEval_RestoreThread(pyThreadState); + if (pyThreadState) { + PyEval_RestoreThread(pyThreadState); + } QFile moduleFile(":/python/cutter_jupyter.py"); moduleFile.open(QIODevice::ReadOnly);