|
17 | 17 | #include "shell.hpp" |
18 | 18 |
|
19 | 19 | RootWrapper::RootWrapper(QString rootPath, QString shellId) |
20 | | - : QObject(nullptr) |
21 | | - , rootPath(std::move(rootPath)) |
22 | | - , shellId(std::move(shellId)) |
23 | | - , originalWorkingDirectory(QDir::current().absolutePath()) { |
| 20 | + : QObject(nullptr) |
| 21 | + , rootPath(std::move(rootPath)) |
| 22 | + , shellId(std::move(shellId)) |
| 23 | + , originalWorkingDirectory(QDir::current().absolutePath()) { |
24 | 24 | // clang-format off |
25 | 25 | QObject::connect(QuickshellSettings::instance(), &QuickshellSettings::watchFilesChanged, this, &RootWrapper::onWatchFilesChanged); |
26 | 26 | // clang-format on |
@@ -92,11 +92,14 @@ void RootWrapper::reloadGraph(bool hard) { |
92 | 92 |
|
93 | 93 | component.completeCreate(); |
94 | 94 |
|
| 95 | + if (this->generation) { |
| 96 | + QObject::disconnect(this->generation, nullptr, this, nullptr); |
| 97 | + } |
| 98 | + |
95 | 99 | auto isReload = this->generation != nullptr; |
96 | 100 | generation->onReload(hard ? nullptr : this->generation); |
97 | 101 |
|
98 | | - if (hard && this->generation != nullptr) { |
99 | | - QObject::disconnect(this->generation, nullptr, this, nullptr); |
| 102 | + if (hard && this->generation) { |
100 | 103 | this->generation->destroy(); |
101 | 104 | } |
102 | 105 |
|
|
0 commit comments