[Freeswitch-svn] [commit] r12564 - freeswitch/trunk/src/mod/languages/mod_spidermonkey

FreeSWITCH SVN mrene at freeswitch.org
Wed Mar 11 06:15:41 PDT 2009


Author: mrene
Date: Wed Mar 11 08:15:41 2009
New Revision: 12564

Log:
Revert 12561

Modified:
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Wed Mar 11 08:15:41 2009
@@ -1146,21 +1146,8 @@
 			switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
 			
 			if (dtmf) {
-				JSString *str = NULL;
-				/* FSCORE-327 - If a javascript garbage collection is in progress, 
-					JS_NewStringCopyZ returns NULL */
-				int try = 100;
-				while (try-- && !str) {
-					if ((str = JS_NewStringCopyZ(cb_state->cx, "dtmf"))) break;
-					switch_yield(10000);
-				}
-				
-				if (!str) {
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Javascript memory allocation failed\n");	
-				}
-				
-				if (str && (Event = new_js_dtmf(dtmf, var_name, cb_state->cx, cb_state->obj))) {
-					argv[argc++] = STRING_TO_JSVAL(str);
+				if ((Event = new_js_dtmf(dtmf, var_name, cb_state->cx, cb_state->obj))) {
+					argv[argc++] = STRING_TO_JSVAL(JS_NewStringCopyZ(cb_state->cx, "dtmf"));
 					argv[argc++] = OBJECT_TO_JSVAL(Event);
 				} else {
 					jss->stack_depth--;



More information about the Freeswitch-svn mailing list