Fix Runner and MatrixImageProvider singletons

This commit is contained in:
Tobias Fella
2023-11-05 14:35:28 +01:00
parent dabd6291a5
commit 1d95d5aa15
3 changed files with 18 additions and 4 deletions

View File

@@ -60,6 +60,13 @@ class MatrixImageProvider : public QQuickAsyncImageProvider
Q_PROPERTY(NeoChatConnection *connection MEMBER m_connection)
public:
static MatrixImageProvider *create(QQmlEngine *engine, QJSEngine *)
{
static MatrixImageProvider instance;
engine->setObjectOwnership(&instance, QQmlEngine::CppOwnership);
return &instance;
}
/**
* @brief Return a job to provide the image with the given ID.
*
@@ -69,4 +76,5 @@ public:
private:
NeoChatConnection *m_connection = nullptr;
MatrixImageProvider() = default;
};