mylisabox / flutter_mjpeg

Flutter widget to show mjpeg stream from URL
BSD 2-Clause "Simplified" License
30 stars 23 forks source link

added a small workaround with useIsMounted to prevent updating dispos… #29

Closed Gorter-dev closed 1 year ago

Gorter-dev commented 1 year ago

…ed valuenotifiers

Gorter-dev commented 1 year ago

@jaumard

For some context:

When using this package (in certain UI configurations) it could happen that the valuenotifier 'image' is updated when the widget itself is already disposed. With these changes it prevents from updating when that is the case.

cybrox commented 1 year ago

Thanks @Gorter-dev!

I agree that the issue of updating disposed widgets exists with flutter_mjpeg. I actually applied a very ugly patch to our fork a while ago to prevent this error from impacting anything.

Can't speak for the maintainer but the code looks good from my point of view :+1: I'll see if I can find some time in the coming days to pull this branch and do some more in-depth test with our apps where I know the issue can be reproduced.

Gorter-dev commented 1 year ago

@cybrox A lot of time later and this PR is still open. Is this package still maintained?

jaumard commented 1 year ago

Sorry for late review guys. Looks good just minor change and that's good for me

cybrox commented 1 year ago

Thanks for looking over it @jaumard. I think this can be merged then?

Ignoring the errors when not mounted anymore is the only reason why I'm still using a dependency override :smile:

jaumard commented 1 year ago

Thanks for this @Gorter-dev !