Subj : memory leak To : netscape.public.mozilla.jseng From : "lyg" Date : Fri Mar 19 2004 11:32 am ok, I fixed the system clock,:-) Sorry for not expressing my question clearly. when I exit my app, I call JS_DestroyRuntime(rt) and JS_ShutDown(). All is controled by JS_THREADSAFE macro. the following is how the JS_ShutDown() is defined. the JS_ShutDown() function is implemented like this in jsapi.c, JS_PUBLIC_API(void) JS_ShutDown(void) { JS_ArenaShutDown(); js_FreeStringGlobals(); #ifdef JS_THREADSAFE js_CleanupLocks(); #endif } and the js_CleanupLocks() in jslock.c is like void js_CleanupLocks() { #ifndef NSPR_LOCK //do something #endif /* !NSPR_LOCK */ js_FinishDtoa(); } and the js_FinishDtoa() in jsdtoa.c: void js_FinishDtoa(void) { #ifdef JS_THREADSAFE if (initialized == JS_TRUE) { PR_DestroyLock(freelist_lock); PR_DestroyLock(p5s_lock); initialized = JS_FALSE; } #endif } .