forked from quickshell/quickshell
core: fix UAF when calling Qt.quit or Qt.exit
A pointer to the last generation had shutdown() called on it after deletion.
This commit is contained in:
parent
e327d6750d
commit
9967e2e03b
2 changed files with 5 additions and 0 deletions
|
@ -96,6 +96,7 @@ void RootWrapper::reloadGraph(bool hard) {
|
||||||
generation->onReload(hard ? nullptr : this->generation);
|
generation->onReload(hard ? nullptr : this->generation);
|
||||||
|
|
||||||
if (hard && this->generation != nullptr) {
|
if (hard && this->generation != nullptr) {
|
||||||
|
QObject::disconnect(this->generation, nullptr, this, nullptr);
|
||||||
this->generation->destroy();
|
this->generation->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +104,7 @@ void RootWrapper::reloadGraph(bool hard) {
|
||||||
|
|
||||||
qInfo() << "Configuration Loaded";
|
qInfo() << "Configuration Loaded";
|
||||||
|
|
||||||
|
QObject::connect(this->generation, &QObject::destroyed, this, &RootWrapper::generationDestroyed);
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
this->generation,
|
this->generation,
|
||||||
&EngineGeneration::filesChanged,
|
&EngineGeneration::filesChanged,
|
||||||
|
@ -117,6 +119,8 @@ void RootWrapper::reloadGraph(bool hard) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RootWrapper::generationDestroyed() { this->generation = nullptr; }
|
||||||
|
|
||||||
void RootWrapper::onWatchFilesChanged() {
|
void RootWrapper::onWatchFilesChanged() {
|
||||||
auto watchFiles = QuickshellSettings::instance()->watchFiles();
|
auto watchFiles = QuickshellSettings::instance()->watchFiles();
|
||||||
if (this->generation != nullptr) {
|
if (this->generation != nullptr) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ public:
|
||||||
void reloadGraph(bool hard);
|
void reloadGraph(bool hard);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void generationDestroyed();
|
||||||
void onWatchFilesChanged();
|
void onWatchFilesChanged();
|
||||||
void onWatchedFilesChanged();
|
void onWatchedFilesChanged();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue