diff --git a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp index 779b2506b..e5bb50571 100644 --- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp +++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp @@ -722,7 +722,8 @@ void PythonContext::outstream_del(PyObject *self) { PythonContext *context = redirector->context; - delete context; + // delete the context on the UI thread. + GUIInvoke::call([context]() { delete context; }); } }