Closed tj10200 closed 2 years ago
opus_encoder_destroy
is only for apps which use opus_encoder_create
. This lib instead uses opus_encoder_init
. From the docs:
Initializes a previously allocated encoder state The memory pointed to by st must be at least the size returned by opus_encoder_get_size().
This is intended for applications which use their own allocator instead of malloc.
This wrapper uses Go's make([]byte, ...)
to allocate memory, so freeing the encoder is a matter of letting it get garbage collected.
Closing the issue but feel free to reopen / continue discussion if there's any further concerns.
Nope that's great, I did misunderstand. Glad I asked, and thanks so much for getting around to it so quickly.
There doesn't appear to be a binding for
opus_encoder_destroy
or the decoder equivalent. If I understand the docs correctly this indicates that the opus state object leaks memory each time an instance is created.Or is there something hidden that I may have missed?