diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-09-16 23:36:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 23:36:53 +0200 |
commit | 0c66289cba2ba1a2b27083baf2424093d201c9cd (patch) | |
tree | 5952cbbba454d4718e7cc10972f925b2c2dad3f1 | |
parent | 2e8103475e18d1e4aa0d6355107f393815a886a6 (diff) | |
parent | b86039b104b7e64d8c75d2afe2f603d2bdaec098 (diff) | |
download | rneovim-0c66289cba2ba1a2b27083baf2424093d201c9cd.tar.gz rneovim-0c66289cba2ba1a2b27083baf2424093d201c9cd.tar.bz2 rneovim-0c66289cba2ba1a2b27083baf2424093d201c9cd.zip |
Merge pull request #15668 from bfredl/logmenu
fix(tests): don't attempt to call ui functions in free_all_mem()
-rw-r--r-- | src/nvim/ui.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 94b6e9e39d..09709d0f43 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -69,9 +69,16 @@ static int pending_has_mouse = -1; #else static size_t uilog_seen = 0; static char uilog_last_event[1024] = { 0 }; + +#ifndef EXITFREE +#define entered_free_all_mem false +#endif + # define UI_LOG(funname) \ do { \ - if (strequal(uilog_last_event, STR(funname))) { \ + if (entered_free_all_mem) { \ + /* do nothing, we cannot log now */ \ + } else if (strequal(uilog_last_event, STR(funname))) { \ uilog_seen++; \ } else { \ if (uilog_seen > 0) { \ @@ -107,6 +114,10 @@ static char uilog_last_event[1024] = { 0 }; # include "ui_events_call.generated.h" #endif +#ifndef EXITFREE +#undef entered_free_all_mem +#endif + void ui_init(void) { default_grid.handle = 1; |