diff --git a/src/control_socket.cpp b/src/control_socket.cpp index f42dd2622..8b8595ea6 100644 --- a/src/control_socket.cpp +++ b/src/control_socket.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2013-2025 CESNET + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -976,8 +976,6 @@ void control_done(struct control_state *s) } assert(s->magic == MODULE_MAGIC); - module_done(&s->mod); - if(s->started) { s->stats_lock.lock(); s->stat_event_queue.push({}); @@ -999,6 +997,8 @@ void control_done(struct control_state *s) CLOSESOCKET(s->socket_fd); } + module_done(&s->mod); + delete s; }