control_socked: fix early module_done

The thread is not joined yet so it may access the module data
(check_message).

This might have caused this failure:
<https://gist.github.com/MartinPulec/8d855d67d4333c8806126814607dcce9>
This commit is contained in:
Martin Pulec
2026-01-07 14:35:41 +01:00
parent 951f9648d9
commit ff7a29db5c

View File

@@ -3,7 +3,7 @@
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* 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;
}