-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added 'unload_zbarcam' that unload zbarcam.kv and xcamera.kv files #81
base: develop
Are you sure you want to change the base?
Conversation
src/kivy_garden/zbarcam/zbarcam.py
Outdated
@@ -210,3 +211,19 @@ def stop(self): | |||
self.xcamera.play = False | |||
if platform == "android": | |||
self.xcamera._camera._release_camera() | |||
|
|||
def unload_zbarcam(self): | |||
id ZBarCam.kv_loaded: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean if
?
Pity we no longer have working tests for this repo, this would have been caught easily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry for typo.
I will fix this and create a new commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pity we no longer have working tests for this repo, this would have been caught easily
Maybe I can work with some github-action to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we would love to 👍
Fixed typo: `id` to `if` on `unload_zbarcam method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
I tried to find where that approach is used in the code you linked, but I didn't find it as in b68fe7b I GitHub searched for unload_file
, but got no results.
I would it make sense to call this method as we call the stop method?
Sorry again 😭 Didn't add this as
I think it make sense, since the
I will wait for response before make any new commit |
Yes for 1 & 2 |
Done. I added a step for releasing devices on non android devices in Sorry for "incomplete" commit message. It was suposed to be:
|
@AndreMiras, did you tested the code? |
I didn't get a chance to. Do you mind giving it a try? |
I can try, but i need some time to apply |
This PR add a
unload_zbarcam
method.This method fixes the issue "restart after releasing the camera results in these warnings followed by pages of errors"
The solution was to unload
zbarcam.kv
andxcamera.kv
files (see this response).A working example with this approach can be found here.