From 4b9c506cdc01f225658d389039ee34f4b1106ab7 Mon Sep 17 00:00:00 2001 From: Ludovic Chenut Date: Thu, 21 Mar 2024 15:44:27 +0100 Subject: [PATCH] Unregister address while closing --- webrtc/sctp.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/sctp.nim b/webrtc/sctp.nim index 91a7cf3..e71e317 100644 --- a/webrtc/sctp.nim +++ b/webrtc/sctp.nim @@ -26,7 +26,6 @@ logScope: # TODO: # - Replace doAssert by a proper exception management # - Find a clean way to manage SCTP ports -# - Unregister address when closing proc perror(error: cstring) {.importc, cdecl, header: "".} proc printf(format: cstring) {.cdecl, importc: "printf", varargs, header: "", gcsafe.} @@ -178,6 +177,7 @@ proc write*(self: SctpConn, s: string) {.async.} = proc close*(self: SctpConn) {.async.} = self.usrsctpAwait: self.sctpSocket.usrsctp_close() + usrsctp_deregister_address(cast[pointer](self)) # -- usrsctp receive data callbacks --