mirror of
https://github.com/micropython/micropython.git
synced 2025-12-15 17:30:14 +01:00
unix: Don't crash if heap locked in prompt_write_history.
Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user