aboutsummaryrefslogtreecommitdiff
path: root/ports/esp8266
diff options
context:
space:
mode:
authorDamien George2018-05-31 23:11:08 +1000
committerDamien George2018-06-12 11:56:25 +1000
commitb2fa1b50edaea43007d692d24391c6f3aa4d15ca (patch)
treea048c894df68b3db11ca6140aed6ec79fae5795e /ports/esp8266
parent522ea80f06a80fd799bd57de351373ceaeeae325 (diff)
ports: Call gc_sweep_all() when doing a soft reset.
This calls finalisers of things like files and sockets to cleanly close them.
Diffstat (limited to 'ports/esp8266')
-rw-r--r--ports/esp8266/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/esp8266/main.c b/ports/esp8266/main.c
index 975262fd1..7e5034b04 100644
--- a/ports/esp8266/main.c
+++ b/ports/esp8266/main.c
@@ -88,6 +88,7 @@ STATIC void mp_reset(void) {
}
void soft_reset(void) {
+ gc_sweep_all();
mp_hal_stdout_tx_str("PYB: soft reboot\r\n");
mp_hal_delay_us(10000); // allow UART to flush output
mp_reset();