aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-09-24 17:26:24 -0400
committerJames McCoy <jamessan@jamessan.com>2018-09-24 22:56:24 -0400
commitd59bf058ab8af0321932fa7be995cbc172379700 (patch)
treee2ffc016d5e13259aca9fbdca3bf1d4f679773f5
parent1bd916df35f69b502e054db7965eb45fe37ce237 (diff)
downloadrneovim-d59bf058ab8af0321932fa7be995cbc172379700.tar.gz
rneovim-d59bf058ab8af0321932fa7be995cbc172379700.tar.bz2
rneovim-d59bf058ab8af0321932fa7be995cbc172379700.zip
log: Assert that we haven't started freeing memory before logging
This is to catch situations like the previous commit, which somehow avoided detection by any of the CI builds.
-rw-r--r--src/nvim/log.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/log.c b/src/nvim/log.c
index 578217db41..719f0da340 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -109,6 +109,12 @@ bool logmsg(int log_level, const char *context, const char *func_name,
return false;
}
+#ifdef EXITFREE
+ // Logging after we've already started freeing all our memory will only cause
+ // pain. We need access to VV_PROGPATH, homedir, etc.
+ assert(!entered_free_all_mem);
+#endif
+
log_lock();
bool ret = false;
FILE *log_file = open_log_file();