Subj : Re: Help with embedding spidermonkey please!!! To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Sat Nov 08 2003 02:18 pm Blacksage wrote: > ScriptEngine::ScriptEngine() > { > cout << "Contstructor Start" << endl; > > m_JSRunTime = NULL; > m_JSContext = NULL; > m_GlobalObject = NULL; > > m_JSRunTime = JS_NewRuntime(4 * 1024 * 1024); > m_JSContext = JS_NewContext(m_JSRunTime, 8 * 1024); > > JSClass globalClass = naming a local variable globalClass does not make it global. After the ScriptEngine constructor finished its work, the global object no longer exists, because it was a local object. Define it as global variable of the application [awful] or as member of the ScriptEngine class [more flexible]. Do not define it as local variable of the ScriptEngine constructor. This must crash or at least cause unpredictionable results. -- Georg Maaß - bioshop.de D-76227 Karlsruhe, Westmarkstraße 82 HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net - The ultimative DHTML engine: http://gml-modul.sourceforge.net - http://sourceforge.net/projects/gml-modul .