Skip to content

Commit 88d5bee

Browse files
committed
1.2.4.1 Some fix
1 parent d88b0ad commit 88d5bee

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

tsc64/Resource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
#define VER_Y 1
77
#define VER_M 2
88
#define VER_D 4
9-
#define VER_Z 0
9+
#define VER_Z 1

tsc64/tsc64.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ HRESULT CTScriptControl::ParseScript(LPOLESTR lpScript, LPOLESTR lpLang, IDispat
513513
}
514514
CteActiveScriptSite *pass = new CteActiveScriptSite(pdex, this);
515515
pas->SetScriptSite(pass);
516-
pass->Release();
517516
TETimer *pCommon = NULL;
518517
if (m_lTimeout) {
519518
IStream *pStream;
@@ -576,6 +575,11 @@ HRESULT CTScriptControl::ParseScript(LPOLESTR lpScript, LPOLESTR lpLang, IDispat
576575
}
577576
}
578577
pasp->Release();
578+
pass->m_pSC = NULL;
579+
if (pass->m_hr != S_OK) {
580+
hr = pass->m_hr;
581+
}
582+
pass->Release();
579583
}
580584
if (!ppdisp || !*ppdisp) {
581585
pas->SetScriptState(SCRIPTSTATE_CLOSED);
@@ -1679,14 +1683,11 @@ CteActiveScriptSite::CteActiveScriptSite(IUnknown *punk, CTScriptControl *pSC)
16791683
{
16801684
m_cRef = 1;
16811685
m_pDispatchEx = NULL;
1682-
m_pSC = NULL;
1686+
m_pSC = pSC;
16831687
if (punk) {
16841688
punk->QueryInterface(IID_PPV_ARGS(&m_pDispatchEx));
16851689
}
1686-
if (pSC) {
1687-
pSC->AddRef();
1688-
m_pSC = pSC;
1689-
}
1690+
m_hr = S_OK;
16901691
}
16911692

16921693
CteActiveScriptSite::~CteActiveScriptSite()
@@ -1773,9 +1774,13 @@ STDMETHODIMP CteActiveScriptSite::OnScriptError(IActiveScriptError *pscripterror
17731774
if (!pscripterror) {
17741775
return E_POINTER;
17751776
}
1777+
if (!m_pSC) {
1778+
return S_OK;
1779+
}
17761780
EXCEPINFO *pei = &m_pSC->m_pError->m_EI;
17771781
teClearExceptInfo(pei);
17781782
if SUCCEEDED(pscripterror->GetExceptionInfo(pei)) {
1783+
m_hr = pei->scode;
17791784
DWORD dwSourceContext = 0;
17801785
pscripterror->GetSourcePosition(&dwSourceContext, &m_pSC->m_pError->m_ulLine, &m_pSC->m_pError->m_lColumn);
17811786
teSysFreeString(&m_pSC->m_pError->m_bsText);

tsc64/tsc64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ class CteActiveScriptSite : public IActiveScriptSite, public IActiveScriptSiteWi
237237
public:
238238
IDispatchEx *m_pDispatchEx;
239239
CTScriptControl *m_pSC;
240+
HRESULT m_hr;
240241
LONG m_cRef;
241242
};
242243

0 commit comments

Comments
 (0)