Make singletons owned by the C++ side
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
// SPDX-FileCopyrightText: 2022 Snehit Sah <hi@snehit.dev>
|
||||
// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
|
||||
@@ -33,8 +34,9 @@ public:
|
||||
static SpaceHierarchyCache _instance;
|
||||
return _instance;
|
||||
}
|
||||
static SpaceHierarchyCache *create(QQmlEngine *, QJSEngine *)
|
||||
static SpaceHierarchyCache *create(QQmlEngine *engine, QJSEngine *)
|
||||
{
|
||||
engine->setObjectOwnership(&instance(), QQmlEngine::CppOwnership);
|
||||
return &instance();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user