forked from qt-creator/qt-creator
Debugger: Delay matplot process initialization
Reduces costs in case the feature is not requested. Change-Id: I66da6f256baaec6ef9d40bc135942551d58e83da Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -91,7 +91,14 @@ except:
|
||||
if hasSubprocess and hasPlot:
|
||||
matplotFigure = {}
|
||||
matplotCount = 0
|
||||
matplotProc = None
|
||||
devNull = None
|
||||
|
||||
def matplotInit():
|
||||
global matplotProc
|
||||
global devNull
|
||||
|
||||
if matplotProc is None:
|
||||
devNull = open(os.devnull)
|
||||
# FIXME: That might not be the one we want.
|
||||
pythonExecutable = sys.executable
|
||||
@@ -109,6 +116,8 @@ if hasSubprocess and hasPlot:
|
||||
global matplotFigure
|
||||
global matplotCount
|
||||
|
||||
matplotInit()
|
||||
|
||||
def s(line):
|
||||
matplotProc.stdin.write(line.encode("latin1"))
|
||||
matplotProc.stdin.write(b"\n")
|
||||
@@ -136,6 +145,8 @@ if hasSubprocess and hasPlot:
|
||||
matplotProc.stdin.flush()
|
||||
|
||||
def matplotQuit():
|
||||
global matplotProc
|
||||
if not matplotProc is None:
|
||||
matplotProc.stdin.write(b"exit")
|
||||
matplotProc.kill()
|
||||
devNull.close()
|
||||
|
Reference in New Issue
Block a user