From f8ef68c4f1ab22abfc80d7f7f784a7029081f510 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 7 Oct 2019 16:18:59 -0400 Subject: [PATCH] Delete ModelBox tooltips in a deferred way to avoid a use-after-free. --- src/app/ModuleBrowser.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index 17432edf..e274eb59 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -219,8 +219,7 @@ struct ModelBox : widget::OpaqueWidget { void setTooltip(ui::Tooltip* tooltip) { if (this->tooltip) { - this->tooltip->parent->removeChild(this->tooltip); - delete this->tooltip; + this->tooltip->requestDelete(); this->tooltip = NULL; }