]> cloud.milkyroute.net Git - dolphin.git/commit
versioncontrol: Prevent a use-after-free in UpdateItemStatesThread
authorMéven Car <meven@kde.org>
Sat, 23 Mar 2024 10:55:37 +0000 (11:55 +0100)
committerMéven Car <meven@kde.org>
Sun, 24 Mar 2024 10:55:54 +0000 (11:55 +0100)
commitd270700c0ef42b6f1e1bef09bbf0bab59b3e78d1
tree9e3949119321c9e99e602c0b97f77290a648789a
parent5795d57dcb601b154a8856df56c2fcab02b6b0f4
versioncontrol: Prevent a use-after-free in UpdateItemStatesThread

UpdateItemStatesThread kept a pointer reference to m_plugin whose
lifetime was tied to VersionControlObserver parents.
On application shutdown it could happen the thread is still running when
the Observer is destroyed.

Make the plugin pointer a weak reference, allowing to stop the thread
when the plugin is gone.

BUG: 477425
src/views/versioncontrol/updateitemstatesthread.cpp
src/views/versioncontrol/updateitemstatesthread.h