Fix potential crash when opening separate rooms
This commit is contained in:
parent
87070289fd
commit
9910244f6b
@ -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 New Issue
Block a user