fix: use QPointer for ImageAnalyser::m_sourceItem
Raw QQuickItem* was not tracked for destruction, causing use-after-free if the source item was destroyed between setSourceItem() and deferred requestUpdate() invocations.
This commit is contained in:
parent
04b4ae3ba8
commit
b85b0e7afb
1 changed files with 2 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
#include <qfuture.h>
|
#include <qfuture.h>
|
||||||
#include <qfuturewatcher.h>
|
#include <qfuturewatcher.h>
|
||||||
#include <qobject.h>
|
#include <qobject.h>
|
||||||
|
#include <qpointer.h>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
namespace caelestia {
|
namespace caelestia {
|
||||||
|
|
@ -48,7 +49,7 @@ private:
|
||||||
QFutureWatcher<AnalyseResult>* const m_futureWatcher;
|
QFutureWatcher<AnalyseResult>* const m_futureWatcher;
|
||||||
|
|
||||||
QString m_source;
|
QString m_source;
|
||||||
QQuickItem* m_sourceItem;
|
QPointer<QQuickItem> m_sourceItem;
|
||||||
int m_rescaleSize;
|
int m_rescaleSize;
|
||||||
|
|
||||||
QColor m_dominantColour;
|
QColor m_dominantColour;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue