Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
3b4a143a
Commit
3b4a143a
authored
Jul 13, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix possible use after deletion.
Fixes
#743
parent
ce7d3d14
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/project/projectmanager.cpp
View file @
3b4a143a
...
...
@@ -282,6 +282,7 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
m_project
=
nullptr
;
}
}
m_mainTimelineModel
.
reset
();
return
true
;
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
3b4a143a
...
...
@@ -90,6 +90,7 @@ TimelineController::~TimelineController()
void
TimelineController
::
prepareClose
()
{
// Clear roor so we don't call its methods anymore
QObject
::
disconnect
(
m_deleteConnection
);
m_ready
=
false
;
m_root
=
nullptr
;
// Delete timeline preview before resetting model so that removing clips from timeline doesn't invalidate
...
...
@@ -105,7 +106,7 @@ void TimelineController::setModel(std::shared_ptr<TimelineItemModel> model)
m_model
=
std
::
move
(
model
);
m_activeSnaps
.
clear
();
connect
(
m_model
.
get
(),
&
TimelineItemModel
::
requestClearAssetView
,
pCore
.
get
(),
&
Core
::
clearAssetPanel
);
connect
(
m_model
.
get
(),
&
TimelineItemModel
::
checkItemDeletion
,
[
this
]
(
int
id
)
{
m_deleteConnection
=
connect
(
m_model
.
get
(),
&
TimelineItemModel
::
checkItemDeletion
,
[
this
]
(
int
id
)
{
if
(
m_ready
)
{
QMetaObject
::
invokeMethod
(
m_root
,
"checkDeletion"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QVariant
,
id
));
}
...
...
src/timeline2/view/timelinecontroller.h
View file @
3b4a143a
...
...
@@ -614,6 +614,7 @@ private:
std
::
vector
<
int
>
m_activeSnaps
;
int
m_snapStackIndex
;
QMetaObject
::
Connection
m_connection
;
QMetaObject
::
Connection
m_deleteConnection
;
void
initializePreview
();
bool
darkBackground
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment