From e8f2db7da3f0e60901b09ee6eada99a9e875497f Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 14 Dec 2016 11:40:11 +1100 Subject: py/runtime: Zero out fs_user_mount array in mp_init. There's no need to force ports to copy-and-paste this initialisation code. If FSUSERMOUNT is enabled then this zeroing out must be done. --- py/runtime.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'py/runtime.c') diff --git a/py/runtime.c b/py/runtime.c index 0ecccbd87..e7e35a081 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -91,6 +91,11 @@ void mp_init(void) { MP_STATE_VM(mp_module_builtins_override_dict) = NULL; #endif + #if MICROPY_FSUSERMOUNT + // zero out the pointers to the user-mounted devices + memset(MP_STATE_VM(fs_user_mount), 0, sizeof(MP_STATE_VM(fs_user_mount))); + #endif + #if MICROPY_PY_THREAD_GIL mp_thread_mutex_init(&MP_STATE_VM(gil_mutex)); #endif -- cgit v1.2.3