Skip to content

Commit

Permalink
Move lock to setter
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-heerwegh committed May 10, 2023
1 parent c5b55e3 commit c10bcc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions djitellopy/tello.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,7 @@ def update_frame(self):
if self.with_queue:
self.frames.append(np.array(frame.to_image()))
else:
with self.lock:
self.frame = np.array(frame.to_image())
self.frame = np.array(frame.to_image())

if self.stopped:
self.container.close()
Expand Down Expand Up @@ -1096,7 +1095,8 @@ def frame(self):

@frame.setter
def frame(self, value):
self._frame = value
with self.lock:
self._frame = value

def stop(self):
"""Stop the frame update worker
Expand Down

0 comments on commit c10bcc3

Please sign in to comment.