Revision
16586
Author
mrene
Date
2010-02-08 16:26:54 -0600 (Mon, 08 Feb 2010)

Log Message

try that Kristian

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c (16585 => 16586)


--- freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c	2010-02-08 19:48:03 UTC (rev 16585)
+++ freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c	2010-02-08 22:26:54 UTC (rev 16586)
@@ -1161,7 +1161,10 @@
 
 	if (do_limit_hash(session, realm, id, max, interval)) {
 		switch_core_session_execute_application(session, app, app_arg);
-		limit_hash_release(session, realm, id);
+		/* Only release the resource if we are still in CS_EXECUTE */
+		if (switch_channel_get_state(switch_core_session_get_channel(session)) == CS_EXECUTE) {
+			limit_hash_release(session, realm, id);			
+		}
 	}
 }