Skip to content

Commit ff7a29d

Browse files
committed
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>
1 parent 951f964 commit ff7a29d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/control_socket.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <pulec@cesnet.cz>
44
*/
55
/*
6-
* Copyright (c) 2013-2025 CESNET
6+
* Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -976,8 +976,6 @@ void control_done(struct control_state *s)
976976
}
977977
assert(s->magic == MODULE_MAGIC);
978978

979-
module_done(&s->mod);
980-
981979
if(s->started) {
982980
s->stats_lock.lock();
983981
s->stat_event_queue.push({});
@@ -999,6 +997,8 @@ void control_done(struct control_state *s)
999997
CLOSESOCKET(s->socket_fd);
1000998
}
1001999

1000+
module_done(&s->mod);
1001+
10021002
delete s;
10031003
}
10041004

0 commit comments

Comments
 (0)