ultralytics / yolo-flutter-app

A Flutter plugin for Ultralytics YOLO computer vision models
https://ultralytics.com
GNU Affero General Public License v3.0
36 stars 14 forks source link

controller.onDispose not working #21

Closed PVeidenberg closed 2 weeks ago

PVeidenberg commented 2 months ago

controller.dispose() is not cleaning UltralyticsYoloCameraController and camera indicating light stays on.

Flutter: 3.19.0 ultralytics_yolo: 0.0.3

pderrenger commented 2 months ago

Hi there! 👋

It sounds like you're facing an issue where the controller.dispose() method isn't properly turning off the camera in UltralyticsYoloCameraController. Could you please ensure that you are calling dispose() on the right instance of the controller and that it's called within the appropriate lifecycle method in Flutter (like dispose() of your StatefulWidget)?

Also, make sure you have no lingering references to the controller that might keep it active beyond the expected lifecycle. If the problem persists, you can try explicitly stopping the camera stream before calling dispose():

controller.stopCamera();
controller.dispose();

If you follow these steps and still see the issue, please provide a minimal code sample that reproduces the problem, and I'd be happy to take a closer look!

Thanks for using Ultralytics! 🚀

github-actions[bot] commented 4 weeks ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐