summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-05-07 20:27:25 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-05-07 20:27:25 +0200
commit9910244f6bedd46ee80e3dd2e3ed7732a8c547de (patch)
tree7fe976ffe91571089a8191980dc8eeca6f720805 /src
parentActivate window that already has the room open if possible (diff)
downloadnheko-9910244f6bedd46ee80e3dd2e3ed7732a8c547de.tar.xz
Fix potential crash when opening separate rooms
Diffstat (limited to 'src')
-rw-r--r--src/timeline/RoomlistModel.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/timeline/RoomlistModel.h b/src/timeline/RoomlistModel.h

index 43713d8b..84c770b7 100644 --- a/src/timeline/RoomlistModel.h +++ b/src/timeline/RoomlistModel.h
@@ -11,6 +11,7 @@ #include <QSharedPointer> #include <QSortFilterProxyModel> #include <QString> +#include <QQmlEngine> #include <set> #include <mtx/responses/sync.hpp> @@ -184,7 +185,9 @@ public slots: void resetCurrentRoom() { roomlistmodel->resetCurrentRoom(); } TimelineModel *getRoomById(const QString &id) const { - return roomlistmodel->getRoomById(id).data(); + auto r = roomlistmodel->getRoomById(id).data(); + QQmlEngine::setObjectOwnership(r, QQmlEngine::CppOwnership); + return r; } RoomPreview getRoomPreviewById(QString roomid) const {