X-Git-Url: http://git.scottworley.com/srec/blobdiff_plain/eebbdf01820ff750bbde555b56d07b78830a7ccb..aea97a2a113605028062f7feb76860bd38383d71:/srec.py?ds=inline diff --git a/srec.py b/srec.py index 7ef4d46..b3abee1 100644 --- a/srec.py +++ b/srec.py @@ -128,15 +128,16 @@ def on_start_button(_: Gtk.Button, stack: Gtk.Stack) -> None: def stop_streams() -> None: global recording, sharing # pylint: disable=global-statement - assert recording is not None - recording.stop() - recording = None + if recording is not None: + recording.stop() + recording = None if sharing is not None: sharing.stop() sharing = None def on_stop_button(_: Gtk.Button, stack: Gtk.Stack) -> None: + assert recording is not None stop_streams() stack.set_visible_child_name("not_recording") @@ -190,6 +191,7 @@ def main() -> None: app = Gtk.Application(application_id='net.chkno.srec') app.connect('activate', on_activate) app.run(None) + stop_streams() if __name__ == '__main__':