Fix possible assertion violation in animations shutdown.
This commit is contained in:
parent
da3b4704bf
commit
f0e95ee933
2 changed files with 8 additions and 0 deletions
|
|
@ -113,6 +113,7 @@ void Manager::stop(not_null<Basic*> animation) {
|
|||
const auto i = ranges::find(_active, value, proj);
|
||||
if (i != end(_active)) {
|
||||
*i = nullptr;
|
||||
_removedWhileUpdating = true;
|
||||
}
|
||||
} else if (empty(_active)) {
|
||||
stopTimer();
|
||||
|
|
@ -138,6 +139,12 @@ void Manager::update() {
|
|||
};
|
||||
_active.erase(ranges::remove_if(_active, isFinished), end(_active));
|
||||
|
||||
if (_removedWhileUpdating) {
|
||||
_removedWhileUpdating = false;
|
||||
const auto proj = &ActiveBasicPointer::get;
|
||||
_active.erase(ranges::remove(_active, nullptr, proj), end(_active));
|
||||
}
|
||||
|
||||
if (!empty(_starting)) {
|
||||
_active.insert(
|
||||
end(_active),
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ private:
|
|||
crl::time _lastUpdateTime = 0;
|
||||
int _timerId = 0;
|
||||
bool _updating = false;
|
||||
bool _removedWhileUpdating = false;
|
||||
bool _scheduled = false;
|
||||
bool _forceImmediateUpdate = false;
|
||||
std::vector<ActiveBasicPointer> _active;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue