diff --git a/scpserver.c b/scpserver.c index 794d6143..da047823 100644 --- a/scpserver.c +++ b/scpserver.c @@ -521,6 +521,9 @@ static void scp_source_free(ScpServer *s) scp->head = node->next; sfree(node); } + + delete_callbacks_for_context(scp); + sfree(scp); } diff --git a/terminal.c b/terminal.c index 242207cc..d64c15bd 100644 --- a/terminal.c +++ b/terminal.c @@ -1804,6 +1804,7 @@ void term_free(Terminal *term) sfree(term->tabs); expire_timer_context(term); + delete_callbacks_for_context(term); conf_free(term->conf); diff --git a/windows/winhsock.c b/windows/winhsock.c index 5bbcfc2c..7f2b4474 100644 --- a/windows/winhsock.c +++ b/windows/winhsock.c @@ -128,6 +128,8 @@ static void sk_handle_close(Socket *s) CloseHandle(hs->recv_H); bufchain_clear(&hs->inputdata); + delete_callbacks_for_context(hs); + sfree(hs); } diff --git a/windows/winnet.c b/windows/winnet.c index a9680795..b8177ce2 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -1344,6 +1344,7 @@ static void sk_net_close(Socket *sock) p_closesocket(s->s); if (s->addr) sk_addr_free(s->addr); + delete_callbacks_for_context(s); sfree(s); }