diff --git a/IPython/core/history.py b/IPython/core/history.py index da10813..c9b8435 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -775,6 +775,7 @@ class HistorySavingThread(threading.Thread): while True: self.history_manager.save_flag.wait() if self.stop_now: + self.db.close() return self.history_manager.save_flag.clear() self.history_manager.writeout_cache(self.db)