Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit a41b111

Browse files
committed
Update preview_kivycamera.py
1 parent 4f7cbca commit a41b111

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/camera4kivy/preview_kivycamera.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ def __init__(self, **kwargs):
3131
self.cg_zoom_level = [1 , 1]
3232
self.window_width = Window.width
3333
if platform == 'ios':
34-
app = App.get_running_app()
35-
app.bind(on_resume = self.on_resume)
34+
self._enable_on_resume()
3635

3736
def __del__(self):
3837
self.disconnect_camera()
3938

39+
@mainthread
40+
def _enable_on_resume(self):
41+
app = App.get_running_app()
42+
app.bind(on_resume = self.on_resume)
43+
4044
def on_resume(self, arg):
4145
Window.update_viewport()
4246

0 commit comments

Comments
 (0)