diff --git a/OATFWGUI/gui_logic.py b/OATFWGUI/gui_logic.py index aa8ec89..445e302 100644 --- a/OATFWGUI/gui_logic.py +++ b/OATFWGUI/gui_logic.py @@ -368,7 +368,8 @@ def upload_fw(self): @Slot() def pio_upload_finished(self): log.info(f'platformio upload finished') - self.avr_dude_logwatch.stop() + if self.logic_state.env_is_avr_based(): + self.avr_dude_logwatch.stop() exit_code = external_processes['platformio'].qproc.exitCode() if exit_code == 0: log.info('Normal exit') diff --git a/OATFWGUI/log_utils.py b/OATFWGUI/log_utils.py index 0a19b48..c112927 100644 --- a/OATFWGUI/log_utils.py +++ b/OATFWGUI/log_utils.py @@ -123,6 +123,9 @@ def file_changed(self, _path: str): self.log.info(line) def stop(self): + if self.tempfile is None: + self.log.warning('Can\'t stop watching None file?') + return self.log.debug(f'Cleaning up logged external file {self.tempfile.name}') self.tempfile.close() self.file_watcher.removePath(self.tempfile.name)