summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-07 14:50:44 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-07 14:50:44 +0200
commitc4f833808af930505017c9389d44a828601e247c (patch)
tree577f9425a910a666e2d6d8cad51a411460ec8cca /src/ex_cmds2.c
parent8858498516108432453526f07783f14c9196e112 (diff)
patch 8.0.0698: crash on exit when using Python function in timer.v8.0.0698
Problem: When a timer uses ":pyeval" or another Python command and it happens to be triggered while exiting a Crash may happen. (Ricky Zhou) Solution: Avoid running a Python command after python_end() was called. Do not trigger timers while exiting. (closes #1824)
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 74dae92b5b..3efa8ca2e5 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1183,6 +1183,7 @@ timer_callback(timer_T *timer)
/*
* Call timers that are due.
* Return the time in msec until the next timer is due.
+ * Returns -1 if there are no pending timers.
*/
long
check_due_timer(void)
@@ -1197,6 +1198,10 @@ check_due_timer(void)
# ifdef WIN3264
LARGE_INTEGER fr;
+ /* Don't run any timers while exiting. */
+ if (exiting)
+ return next_due;
+
QueryPerformanceFrequency(&fr);
# endif
profile_start(&now);