quickshell/src/core/rootwrapper.hpp
outfoxxed 9967e2e03b
core: fix UAF when calling Qt.quit or Qt.exit
A pointer to the last generation had shutdown() called on it after deletion.
2024-08-28 15:30:02 -07:00

31 lines
601 B
C++

#pragma once
#include <qobject.h>
#include <qqmlengine.h>
#include <qtclasshelpermacros.h>
#include <qtmetamacros.h>
#include <qurl.h>
#include "generation.hpp"
class RootWrapper: public QObject {
Q_OBJECT;
public:
explicit RootWrapper(QString rootPath, QString shellId);
~RootWrapper() override;
Q_DISABLE_COPY_MOVE(RootWrapper);
void reloadGraph(bool hard);
private slots:
void generationDestroyed();
void onWatchFilesChanged();
void onWatchedFilesChanged();
private:
QString rootPath;
QString shellId;
EngineGeneration* generation = nullptr;
QString originalWorkingDirectory;
};