mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Fix ub in windowTitleHook
Called `updateTabBarRecursive` with null thisptr.
This commit is contained in:
parent
90f36e3b00
commit
45fb1698c1
1 changed files with 4 additions and 2 deletions
|
@ -601,10 +601,10 @@ void Hy3Node::updateTabBar() {
|
|||
void Hy3Node::updateTabBarRecursive() {
|
||||
auto* node = this;
|
||||
|
||||
while (node != nullptr) {
|
||||
do {
|
||||
node->updateTabBar();
|
||||
node = node->parent;
|
||||
}
|
||||
} while (node != nullptr);
|
||||
}
|
||||
|
||||
void Hy3Node::updateDecos() {
|
||||
|
@ -1675,6 +1675,8 @@ void Hy3Layout::windowTitleHook(void*, std::any data) {
|
|||
if (window == nullptr) return;
|
||||
auto* node = g_Hy3Layout->getNodeFromWindow(window);
|
||||
|
||||
// it is UB for `this` to be null
|
||||
if (node == nullptr) return;
|
||||
node->updateTabBarRecursive();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue