Unity-Technologies / barracuda-release

Other
567 stars 77 forks source link

[CRASH] Cannot dispose/release ComputeBuffer when move to other scene after using Barracuda #274

Closed CanvasVu closed 2 years ago

CanvasVu commented 2 years ago

I'm using a project on Github link: https://github.com/wojciechp6/YOLO-UnityBarracuda, This project using Barracuda (version 0.7.0) combine with YOLOv2 Tiny to make object detection app, Everything okay but when I move to other scene, ComputeBuffer cannot disposed (see attached log image). When on UnityEditor that will be okay (can move to other scene) but in built app, it's will crash. (I tried Barracuda version 0.7.0 to 1.4.0 but same issue)

My dispose code: image (see more in attached file) YOLOHandler.txt

※Question: How can I dispose/release undisposed ComputeBuffer or some another way to make built app not crash when move to other scene after using Barracuda? Note: In development build mode, built app will not crash when move to another scene.

Thanks for reading.

image

CanvasVu commented 2 years ago

Fixed! Change to below code:

image

paTRICK-swk commented 8 months ago

My life saver!