mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-04-10 06:11:54 +10:00
core: derive incubation controllers from tracked windows list
Replaces the attempts to track incubation controllers directly with a list of all known windows, then pulls the first usable incubation controller when an assignment is requested. This should finally fix incubation controller related use after free crashes.
This commit is contained in:
parent
59f5744f30
commit
e9a574d919
3 changed files with 27 additions and 103 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <qqmlengine.h>
|
||||
#include <qqmlerror.h>
|
||||
#include <qqmlincubator.h>
|
||||
#include <qquickwindow.h>
|
||||
#include <qtclasshelpermacros.h>
|
||||
|
||||
#include "incubator.hpp"
|
||||
|
|
@ -40,8 +41,7 @@ public:
|
|||
void setWatchingFiles(bool watching);
|
||||
bool setExtraWatchedFiles(const QVector<QString>& files);
|
||||
|
||||
void registerIncubationController(QQmlIncubationController* controller);
|
||||
void deregisterIncubationController(QQmlIncubationController* controller);
|
||||
void trackWindowIncubationController(QQuickWindow* window);
|
||||
|
||||
// takes ownership
|
||||
void registerExtension(const void* key, EngineGenerationExt* extension);
|
||||
|
|
@ -84,13 +84,13 @@ public slots:
|
|||
private slots:
|
||||
void onFileChanged(const QString& name);
|
||||
void onDirectoryChanged();
|
||||
void incubationControllerDestroyed();
|
||||
void onTrackedWindowDestroyed(QObject* object);
|
||||
static void onEngineWarnings(const QList<QQmlError>& warnings);
|
||||
|
||||
private:
|
||||
void postReload();
|
||||
void assignIncubationController();
|
||||
QVector<QObject*> incubationControllers;
|
||||
QVector<QQuickWindow*> trackedWindows;
|
||||
bool incubationControllersLocked = false;
|
||||
QHash<const void*, EngineGenerationExt*> extensions;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue