diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-05-09 16:35:47 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-05-19 09:39:39 +0000 |
commit | bf96cd2496adc1513d10228630fea7f01c4c8136 (patch) | |
tree | a06de85e6dcdeea517d457b725cae5b229de16da | |
parent | f67a778d2e2f95c2102f5615cac841319e12ff6e (diff) |
QmlDesigner: Fix crash on shutdown
Change-Id: I95c37a33d7ad346b9d5d031bbfe022527c70e253
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r-- | src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp | 3 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/timelineeditor/timelineview.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp index a8b20f8380..7272735be2 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp @@ -89,7 +89,8 @@ void TimelineView::modelAttached(Model *model) void TimelineView::modelAboutToBeDetached(Model *model) { - m_timelineWidget->reset(); + if (!m_timelineWidget) + m_timelineWidget->reset(); const bool empty = getTimelines().isEmpty(); if (!empty) setTimelineRecording(false); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.h b/src/plugins/qmldesigner/components/timelineeditor/timelineview.h index f1f39b6a35..13efe40ba3 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.h @@ -100,7 +100,7 @@ public: private: TimelineWidget *createWidget(); - TimelineWidget *m_timelineWidget = nullptr; + QPointer<TimelineWidget> m_timelineWidget; bool hasQtQuickTimelineImport(); void ensureQtQuickTimelineImport(); }; |