From: Chris Rienzo Date: Mon, 27 Oct 2014 14:05:12 +0000 (-0400) Subject: FS-6929 #resolve #comment fix deadlock in mod_rayo X-Git-Tag: v1.4.13~1^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57e8231cba93f9d4c73010fc3734586722481eb5;p=thirdparty%2Ffreeswitch.git FS-6929 #resolve #comment fix deadlock in mod_rayo --- diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index 00e74f8e47..f1c201c4e3 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -948,19 +948,20 @@ void rayo_actor_destroy(struct rayo_actor *actor, const char *file, int line) } else { switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "", line, "", SWITCH_LOG_DEBUG, "Destroying %s\n", RAYO_JID(actor)); } + switch_core_hash_delete(globals.destroy_actors, RAYO_JID(actor)); + switch_mutex_unlock(globals.actors_mutex); + /* safe to destroy parent now */ if (actor->cleanup_fn) { actor->cleanup_fn(actor); } if (actor->parent) { - /* safe to destroy parent now */ RAYO_RELEASE(actor->parent); } - switch_core_hash_delete(globals.destroy_actors, RAYO_JID(actor)); switch_core_destroy_memory_pool(&pool); } else { switch_core_hash_insert(globals.destroy_actors, RAYO_JID(actor), actor); + switch_mutex_unlock(globals.actors_mutex); } - switch_mutex_unlock(globals.actors_mutex); } /**