unix: Don't crash if heap locked in prompt_write_history.
Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
parent
b5fcb33eaa
commit
8e596c6050
1 changed files with 3 additions and 0 deletions
|
|
@ -104,6 +104,9 @@ void prompt_write_history(void) {
|
|||
#if MICROPY_USE_READLINE == 1
|
||||
char *home = getenv("HOME");
|
||||
if (home != NULL) {
|
||||
if (MP_STATE_THREAD(gc_lock_depth) != 0) {
|
||||
return;
|
||||
}
|
||||
vstr_t vstr;
|
||||
vstr_init(&vstr, 50);
|
||||
vstr_printf(&vstr, "%s/.micropython.history", home);
|
||||
|
|
|
|||
Loading…
Reference in a new issue