diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-06-16 18:47:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-06-16 18:47:20 +0100 |
commit | c72e31dfcc013ae840cd7f8899f2430b7f6812c9 (patch) | |
tree | 9c8aed4f3e53e7b224ad3849c55052ea744b11bd /src/os_unix.c | |
parent | a272624c763fea9f98510bbc5b1f2b65a309c765 (diff) | |
download | vim-git-c72e31dfcc013ae840cd7f8899f2430b7f6812c9.tar.gz |
patch 8.2.5113: timer becomes invalid after fork/exec, :gui gives errorsv8.2.5113
Problem: Timer becomes invalid after fork/exec, :gui gives errors. (Gabriel
Dupras)
Solution: Delete the timer befor forking. (closes #10584)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 766deac9a..6fd24508d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -8247,7 +8247,7 @@ xsmp_close(void) #endif // USE_XSMP #if defined(FEAT_RELTIME) || defined(PROTO) -# if defined(HAVE_TIMER_CREATE) +# if defined(HAVE_TIMER_CREATE) || defined(PROTO) /* * Implement timeout with timer_create() and timer_settime(). */ @@ -8331,6 +8331,19 @@ start_timeout(long msec) return &timeout_flag; } +/* + * To be used before fork/exec: delete any created timer. + */ + void +delete_timer(void) +{ + if (timer_created) + { + timer_delete(timer_id); + timer_created = FALSE; + } +} + # else /* |