diff options
author | Wez Furlong <wez@php.net> | 2004-07-27 03:57:31 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-07-27 03:57:31 +0000 |
commit | ac878007602a8fb06d17de5daa559a31fabf85cb (patch) | |
tree | acdab5fc7b344e371d385039ae67da71f95e9324 /sapi/activescript/classfactory.cpp | |
parent | 3e327b6e21b2fa10ab08935f4eb10f18b0c8d960 (diff) | |
download | php-git-ac878007602a8fb06d17de5daa559a31fabf85cb.tar.gz |
Major re-jig.
With thanks to Rob Richards for tracking down a couple of big bugs caused by
teeny bits of code.
Diffstat (limited to 'sapi/activescript/classfactory.cpp')
-rw-r--r-- | sapi/activescript/classfactory.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sapi/activescript/classfactory.cpp b/sapi/activescript/classfactory.cpp index bd0416d7ed..5fa37c9f03 100644 --- a/sapi/activescript/classfactory.cpp +++ b/sapi/activescript/classfactory.cpp @@ -98,11 +98,15 @@ STDMETHODIMP TPHPClassFactory::LockServer(BOOL fLock) STDMETHODIMP TPHPClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppvObject) { - TPHPScriptingEngine *engine = new TPHPScriptingEngine; + IUnknown *punk = create_scripting_engine(NULL); + HRESULT ret; - HRESULT ret = engine->QueryInterface(iid, ppvObject); - - engine->Release(); + if (punk) { + ret = punk->QueryInterface(iid, ppvObject); + punk->Release(); + } else { + ret = E_UNEXPECTED; + } return ret; } @@ -161,7 +165,13 @@ static const GUID *script_engine_categories[] = { }; static const struct reg_class classes_to_register[] = { - { &CLSID_PHPActiveScriptEngine, "PHP Active Script Engine", "Both", engine_entries, script_engine_categories }, + { &CLSID_PHPActiveScriptEngine, "PHP Active Script Engine", +#if ACTIVEPHP_THREADING_MODE == COINIT_MULTITHREADED + "Both", +#else + "Apartment", +#endif + engine_entries, script_engine_categories }, { NULL, NULL, NULL, 0, NULL } }; /* }}} */ |