diff --git a/klippy/klippy.py b/klippy/klippy.py index 187b45e5..03095d06 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -1,10 +1,10 @@ #!/usr/bin/env python2 # Main code for host side printer firmware # -# Copyright (C) 2016-2018 Kevin O'Connor +# Copyright (C) 2016-2020 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. -import sys, os, optparse, logging, time, threading, collections, importlib +import sys, os, gc, optparse, logging, time, threading, collections, importlib import util, reactor, queuelogger, msgproto, homing import gcode, configfile, pins, mcu, toolhead, webhooks @@ -312,6 +312,7 @@ def main(): if bglogger is not None: bglogger.clear_rollover_info() bglogger.set_rollover_info('versions', versions) + gc.collect() main_reactor = reactor.Reactor() printer = Printer(main_reactor, bglogger, start_args) res = printer.run() @@ -319,6 +320,7 @@ def main(): break time.sleep(1.) main_reactor.finalize() + main_reactor = printer = None logging.info("Restarting printer") start_args['start_reason'] = res