raylib: don't create vipc client twice first time

pull/36323/head
Shane Smiskol 2 days ago
parent 32f65bae55
commit 5f7b05e808
  1. 3
      selfdrive/ui/onroad/cameraview.py

@ -107,7 +107,8 @@ class CameraView(Widget):
ui_state.add_offroad_transition_callback(self._offroad_transition) ui_state.add_offroad_transition_callback(self._offroad_transition)
def _offroad_transition(self): def _offroad_transition(self):
if ui_state.is_onroad(): # Reconnect if not first time going onroad
if ui_state.is_onroad() and self.frame is not None:
# Prevent old frames from showing when going onroad. Qt has a separate thread # Prevent old frames from showing when going onroad. Qt has a separate thread
# which drains the VisionIpcClient SubSocket for us. Re-connecting is not enough # which drains the VisionIpcClient SubSocket for us. Re-connecting is not enough
# and only clears internal buffers, not the message queue. # and only clears internal buffers, not the message queue.

Loading…
Cancel
Save