From ceedd4037029fe8d61cccbdcbbd42ee1993c5e6f Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 27 Jan 2015 11:47:02 +0000 Subject: res_parking: Fix crash due to race condition when unloading. There is currently a race condition when unloading the res_parking module. Depending on the will of the universe the subscription invocation may occur AFTER the module is unloaded. This is because the module does NOT use stasis_unsubscribe_and_join when terminating the subscription. It merely uses stasis_unsubscribe. This change makes it use stasis_unsubscribe_and_join which is documented for usage in this exact scenario. AST-1520 #close Review: https://reviewboard.asterisk.org/r/4375/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431114 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/parking/parking_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'res/parking/parking_manager.c') diff --git a/res/parking/parking_manager.c b/res/parking/parking_manager.c index 74b455928..b9e46c7d5 100644 --- a/res/parking/parking_manager.c +++ b/res/parking/parking_manager.c @@ -689,7 +689,7 @@ int load_parking_manager(void) static void parking_manager_disable_stasis(void) { - parking_sub = stasis_unsubscribe(parking_sub); + parking_sub = stasis_unsubscribe_and_join(parking_sub); } void unload_parking_manager(void) -- cgit v1.2.3