Make singletons owned by the C++ side

This commit is contained in:
Tobias Fella
2023-10-01 19:07:10 +02:00
parent 541350e678
commit d4cb27eca4
7 changed files with 15 additions and 7 deletions

View File

@@ -90,8 +90,9 @@ public:
explicit RoomManager(QObject *parent = nullptr);
virtual ~RoomManager();
static RoomManager &instance();
static RoomManager *create(QQmlEngine *, QJSEngine *)
static RoomManager *create(QQmlEngine *engine, QJSEngine *)
{
engine->setObjectOwnership(&instance(), QQmlEngine::CppOwnership);
return &instance();
}