mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix potential crash when opening separate rooms
This commit is contained in:
parent
87070289fd
commit
9910244f6b
1 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QQmlEngine>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include <mtx/responses/sync.hpp>
|
#include <mtx/responses/sync.hpp>
|
||||||
|
@ -184,7 +185,9 @@ public slots:
|
||||||
void resetCurrentRoom() { roomlistmodel->resetCurrentRoom(); }
|
void resetCurrentRoom() { roomlistmodel->resetCurrentRoom(); }
|
||||||
TimelineModel *getRoomById(const QString &id) const
|
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
|
RoomPreview getRoomPreviewById(QString roomid) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue