mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Fix shutdown crash caused by modules being left open.
It is only safe to run ast_register_cleanup callbacks when all modules have been unloaded. Previously these callbacks were run during graceful shutdown, making it possible to crash during shutdown. ASTERISK-26513 #close Change-Id: Ibfa635bb688d1227ec54aa211d90d6bd45052e21
This commit is contained in:
@@ -2010,8 +2010,9 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart)
|
||||
struct ast_json *json_object = NULL;
|
||||
int run_cleanups = niceness >= SHUTDOWN_NICE;
|
||||
|
||||
if (run_cleanups) {
|
||||
ast_module_shutdown();
|
||||
if (run_cleanups && modules_shutdown()) {
|
||||
ast_verb(0, "Some modules could not be unloaded, switching to fast shutdown\n");
|
||||
run_cleanups = 0;
|
||||
}
|
||||
|
||||
if (!restart) {
|
||||
|
Reference in New Issue
Block a user