Manage MessageContentModels properly so we don't leak memory.
- Manage MessageContentModels properly so we don't leak memory creating new ones every time the role is refreshed. - Parent and reply MessageContentModels to their message to make sure they get cleaned up when the parent is deleted. - Make sure ReactionModels are cleaned up on room change to stop that list just growing.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <QQmlEngine>
|
||||
|
||||
#include "linkpreviewer.h"
|
||||
#include "messagecontentmodel.h"
|
||||
#include "neochatroom.h"
|
||||
#include "neochatroommember.h"
|
||||
#include "pollhandler.h"
|
||||
@@ -117,6 +118,7 @@ private:
|
||||
KFormat m_format;
|
||||
|
||||
std::map<QString, std::unique_ptr<NeochatRoomMember>> m_memberObjects;
|
||||
std::map<QString, std::unique_ptr<MessageContentModel>> m_contentModels;
|
||||
QMap<QString, QSharedPointer<ReadMarkerModel>> m_readMarkerModels;
|
||||
QMap<QString, QSharedPointer<ReactionModel>> m_reactionModels;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user