aboutsummaryrefslogtreecommitdiff
path: root/CruUI/timer.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-19 22:39:16 +0800
committercrupest <crupest@outlook.com>2018-09-19 22:39:16 +0800
commit9caec47adf266946fdce290aaf5ec0c865197650 (patch)
tree897cb30a1ac5232f80d423a09f21c2c5cf88ddac /CruUI/timer.cpp
parent938391d2e0654bf2f57a67871753a056023e0d2c (diff)
downloadcru-9caec47adf266946fdce290aaf5ec0c865197650.tar.gz
cru-9caec47adf266946fdce290aaf5ec0c865197650.tar.bz2
cru-9caec47adf266946fdce290aaf5ec0c865197650.zip
Add InvokeLater in KillTimer.
Diffstat (limited to 'CruUI/timer.cpp')
-rw-r--r--CruUI/timer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/CruUI/timer.cpp b/CruUI/timer.cpp
index f596dde4..ce800eee 100644
--- a/CruUI/timer.cpp
+++ b/CruUI/timer.cpp
@@ -22,7 +22,11 @@ namespace cru
if (find_result != map_.cend())
{
::KillTimer(Application::GetInstance()->GetGodWindow()->GetHandle(), id);
- map_.erase(find_result);
+ // When timer is killed in tick action, we need to retain the action itself until the action finishes, so InvokeLater!
+ InvokeLater([=]
+ {
+ map_.erase(find_result);
+ });
}
}