Subj : Re: memory leak To : netscape.public.mozilla.jseng From : "lyg" Date : Fri Mar 19 2004 05:02 pm #ifdef JS_THREADSAFE js_CleanupLocks(); #endif I did not Define JS_THREADSAFE because there is one thread in my app, so js_FinishDtoa is not be called. Is it possible that Balloc() is called if i don't define JS_THREADSAFE ? and how i free the malloced mem in Bolloc() if i don't define it? thanks for your help for many times! "Brendan Eich" wrote in message news:40595B1E.5040604@meer.net... > lyg wrote: > > in my app, memory leak often happened in > > static Bigint *Balloc(int32 k) in jsdtoa.c > > > > It seems that the malloced memery is not freed, is this a bug or because I > > don't Call api to free it ? i suppose the problem is concerned with "static > > Bigint *freelist[Kmax+1]" in jsdtoa.c;" > > That's cleaned up by js_FinishDtoa, called by JS_ShutDown. You are > calling JS_ShutDown after all other API calls, when shutting down the > engine, aren't you? You should be. > > /be .