You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a problem where calling Stream.Close() causes a crash in my app.
The call was fine when the app was closing down. i.e. when other go routines being killed.
The reason, Stream.Listen() spawns a go routine with no exit feature, so it will keep polling the Stream even if it has been Closed. This of course results in a memory access violation.
I assume the reason testing hasn't picked this up before is because Steam.Close() is usually only called on exit.
I am using the following in my project to allow a stream to stop listening.
It's a slight API change adding a stop signal to Stream.Listen().
Though it might be a good idea to use the context package...
I ran into a problem where calling
Stream.Close()
causes a crash in my app.The call was fine when the app was closing down. i.e. when other go routines being killed.
The reason,
Stream.Listen()
spawns a go routine with no exit feature, so it will keep polling the Stream even if it has been Closed. This of course results in a memory access violation.I assume the reason testing hasn't picked this up before is because
Steam.Close()
is usually only called on exit.I am using the following in my project to allow a stream to stop listening.
It's a slight API change adding a stop signal to
Stream.Listen()
.Though it might be a good idea to use the
context
package...The text was updated successfully, but these errors were encountered: