Fix Use After Free MessageDelegateBase
Make sure that a `MessageDelegateBase` is not used after free by a `MessageObjectIncubator` callback by tracking them and cleaning them up on deletion of a `MessageDelegateBase`
This commit is contained in:
@@ -126,6 +126,7 @@ class MessageDelegateBase : public TimelineDelegate
|
||||
|
||||
public:
|
||||
MessageDelegateBase(QQuickItem *parent = nullptr);
|
||||
~MessageDelegateBase();
|
||||
|
||||
NeochatRoomMember *author() const;
|
||||
void setAuthor(NeochatRoomMember *author);
|
||||
@@ -193,6 +194,8 @@ private:
|
||||
|
||||
bool m_isThreaded = false;
|
||||
|
||||
std::vector<MessageObjectIncubator *> m_activeIncubators;
|
||||
|
||||
QPointer<QQmlComponent> m_avatarComponent;
|
||||
bool m_avatarIncubating = false;
|
||||
QPointer<QQuickItem> m_avatarItem;
|
||||
|
||||
Reference in New Issue
Block a user