aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythoneditor.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2024-11-14 14:28:32 +0100
committerDavid Schulz <david.schulz@qt.io>2024-11-15 05:35:55 +0000
commitb8bc12b3abc1179903ca68272a1fca01069ffa72 (patch)
tree078296f6ca98b2a1736375423ac94d34901a6af5 /src/plugins/python/pythoneditor.cpp
parent67d7906a7059730f14eacd252151d3e7e322bdbc (diff)
Python: fix crash on shutdown
Do not add a temporary document to a Language Client since it will not get properly removed when it is closed again. Fixes: QTCREATORBUG-32011 Change-Id: I66dfddec10610e54c1ae53e4a5e9db828ed03182 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythoneditor.cpp')
-rw-r--r--src/plugins/python/pythoneditor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/python/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp
index 64ad03052d7..5854b92d3de 100644
--- a/src/plugins/python/pythoneditor.cpp
+++ b/src/plugins/python/pythoneditor.cpp
@@ -297,7 +297,8 @@ PythonDocument::PythonDocument()
void PythonDocument::updateCurrentPython()
{
- updatePython(detectPython(filePath()));
+ if (Core::DocumentModel::entryForDocument(this))
+ updatePython(detectPython(filePath()));
}
void PythonDocument::updatePython(const FilePath &python)