Subj : Re: Narrowed the problem down to... To : Sterling Bates From : Brendan Eich Date : Tue Nov 04 2003 03:25 pm Sterling Bates wrote: >...this line: > > FJSObject := >JS_DefineObject(FContext,JS_GetGlobalObject(FContext),FName,@bridge_class,ni >l,0); > >Where: FContext is a running context (from another object), FName is a const >char * == "bridge", bridge_class is properly defined (at least other working >class definitions don't change things), etc. > >If I comment this line out, msvcr70.dll is happy. As soon as it's >reintroduced, a breakpoint is fired when destroying the context. > What's the stack? What exactly is that context? You say it's a "running context from another object" -- what does that mean? Is there more than one thread involved here? You can't use a context on two threads at the same time, of course. >The only thought I had concerning the freeing up of the JSObject is the >ownership of |const char * name| for the object. Who is responsible for >cleaning that up? > It's almost never the case that a caller "hands off" ownership of a string to a callee. This case is typical: the caller owns the string, the callee will have to make a copy if it needs one (but JS doesn't use char, it uses jschar for Unicode, so any "copy" made by JS_DefineProperty or a subroutine of it won't be a duplicate char string, anyway). /be .