From b2fa1b50edaea43007d692d24391c6f3aa4d15ca Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 31 May 2018 23:11:08 +1000 Subject: ports: Call gc_sweep_all() when doing a soft reset. This calls finalisers of things like files and sockets to cleanly close them. --- ports/unix/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ports/unix') diff --git a/ports/unix/main.c b/ports/unix/main.c index b68fe9279..1cf237a2b 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -647,6 +647,10 @@ MP_NOINLINE int main_(int argc, char **argv) { } #endif + #if defined(MICROPY_UNIX_COVERAGE) + gc_sweep_all(); + #endif + mp_deinit(); #if MICROPY_ENABLE_GC && !defined(NDEBUG) -- cgit v1.2.3