Open RamblingGeekUK opened 4 years ago
Could you make a small repro?
Thanks for the quick reply. 😁
here is a repo of the code: https://github.com/RamblingGeekUK/led 😀
I'm using the prebuild binary copied to /usr/local/lib and when I run the code I get the following output
this is the HAT I'm using : https://www.waveshare.com/wiki/RGB_LED_HAT
Ok, didn't expect you're using the sample 1:1
I would assume the bug lies around here as there is no point in code where _leds
is set to null
which could potentially result in a double free of the native handle. However, the dispose pattern is implemented very bad in general. There is no differentiation between native stuff and managed objects. Also the finalizer is missing. Sadly I'm currently busy moving to a new flat so I don't have time to fix it properly. My current advice would be to avoid disposing the strip. Also, disposing is not needed when the program terminates afterwards.
Thanks for taking the time to look into this, very much appreciated. That's stopped it crashing, and the LED's come on, all be it not the colour set.
Yeah sorry, I was just trying to get things working using the sample before moving onwards. 😁
Good luck with the move and be safe -thanks again.
when I run the sample code, the HAT lights - the wrong colour and crashes with this error... PI3 .net core 3.1