Skip to content

Commit

Permalink
Fix bug when changing aircraft
Browse files Browse the repository at this point in the history
  • Loading branch information
maartentamboer committed Apr 2, 2021
1 parent 6f467f3 commit 6c3981f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activelayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ def subscribe_to_layer_change(self, callback):

def subscribe_to_activity(self, callback):
self._activity_events.append(callback)

def clear_all_subscriptions(self):
self._layer_change_events.clear()
self._activity_events.clear()
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from globalstorage import GlobalStorage
from mocksimconnect import MockAircraftEvents, MockAircraftRequests
from activelayerchanger import ActiveLayerChanger
from activelayer import ActiveLayer


def main_app(offline: bool):
Expand All @@ -29,6 +30,8 @@ def main_app(offline: bool):
global_storage.set_aircraft_events(MockAircraftEvents())
global_storage.set_aircraft_requests(MockAircraftRequests())

ActiveLayer().clear_all_subscriptions()

print('Midi input devices:', mido.get_input_names())
print('Midi output devices:', mido.get_output_names())
selected_input = ConfigFile.get_midi_input()
Expand Down

0 comments on commit 6c3981f

Please sign in to comment.