mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-16 00:41:19 +02:00
Fix memory leak in QML surfaces
This commit is contained in:
parent
4db83230ce
commit
6640313256
1 changed files with 2 additions and 1 deletions
|
@ -115,6 +115,7 @@ private:
|
|||
class UrlHandler : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
UrlHandler(QObject* parent = nullptr) : QObject(parent) {}
|
||||
Q_INVOKABLE bool canHandleUrl(const QString& url) {
|
||||
static auto handler = dynamic_cast<AbstractUriHandler*>(qApp);
|
||||
return handler && handler->canAcceptURL(url);
|
||||
|
@ -257,7 +258,7 @@ void OffscreenQmlSurface::initializeEngine(QQmlEngine* engine) {
|
|||
|
||||
auto rootContext = engine->rootContext();
|
||||
rootContext->setContextProperty("GL", ::getGLContextData());
|
||||
rootContext->setContextProperty("urlHandler", new UrlHandler());
|
||||
rootContext->setContextProperty("urlHandler", new UrlHandler(rootContext));
|
||||
rootContext->setContextProperty("resourceDirectoryUrl", QUrl::fromLocalFile(PathUtils::resourcesPath()));
|
||||
rootContext->setContextProperty("ApplicationInterface", qApp);
|
||||
auto javaScriptToInject = getEventBridgeJavascript();
|
||||
|
|
Loading…
Reference in a new issue