Subj : Re: Integration of Spider monkey with DOM To : Pradip Singh From : Brendan Eich Date : Thu Feb 05 2004 09:29 pm Pradip Singh wrote: > JSBool get_nodeName(JSContext *cx, JSObject *obj, uintN argc, jsval > *argv, jsval *rval){ > XMLString tXtr=GetNodePointer(cx,obj)->get_nodeName(); > JSString* > tJStr=JS_NewString(cx,tXtr.GetBufferPointer(),tXtr.CharLength()); You haven't shown enough code to diagnose everything, but you are misusing JS_NewString here. It takes ownership of the string passed via the second argument. You want JS_NewStringCopyN. /be .