lerenn / asyncapi-codegen

An AsyncAPI Golang Code generator that generates all Go code from the broker to the application/user. Just plug your application to your favorite message broker!
Apache License 2.0
90 stars 23 forks source link

Fix double Close() panic #38

Closed lerenn closed 1 year ago

lerenn commented 1 year ago

When using the App controller or the Client controller, if the Close() function is called twice or more, then the second call will trigger a panic as the error channel is already closed.

This commit puts the channel at nil and checks if it wasn't already closed before closing it.