From dbcb6a35b0cf47bac83d596a239a61b0084f9f4c Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Jun 2020 11:57:05 +0400 Subject: [PATCH] Fix possible crash in InnerDropdown hiding. --- ui/widgets/inner_dropdown.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/widgets/inner_dropdown.cpp b/ui/widgets/inner_dropdown.cpp index 0c793c8..98f40f5 100644 --- a/ui/widgets/inner_dropdown.cpp +++ b/ui/widgets/inner_dropdown.cpp @@ -247,15 +247,16 @@ void InnerDropdown::hideFinished() { void InnerDropdown::prepareCache() { if (_a_opacity.animating()) return; + const auto animating = _a_show.animating(); auto showAnimation = base::take(_a_show); auto showAnimationData = base::take(_showAnimation); showChildren(); _cache = GrabWidget(this); - _showAnimation = base::take(showAnimationData); - _a_show = base::take(showAnimation); - if (_a_show.animating()) { + if (animating) { hideChildren(); } + _showAnimation = base::take(showAnimationData); + _a_show = base::take(showAnimation); } void InnerDropdown::startOpacityAnimation(bool hiding) {