CorRuntimeHostBase()
:m_Started(FALSE),
m_cRef(0)
- , m_fStarted(FALSE)
{LIMITED_METHOD_CONTRACT;}
STDMETHODIMP_(ULONG) AddRef(void);
LONG m_cRef; // Ref count.
- // This flag will be used to ensure that a CoreCLR host can invoke Start/Stop in pairs only.
- BOOL m_fStarted;
- BOOL m_fAppDomainCreated; // this flag is used when an appdomain can only create a single appdomain
-
static ULONG m_Version; // Version of ICorRuntimeHost.
// Some functions are only available in ICLRRuntimeHost.
// Some functions are no-op in ICLRRuntimeHost.
// This flag indicates if this instance was the first to load and start CoreCLR
BOOL m_fFirstToLoadCLR;
- // This flag indicates if the host has authenticated with us or not
- BOOL m_fIsHostAuthenticated;
-
+ // This flag will be used to ensure that a CoreCLR host can invoke Start/Stop in pairs only.
+ BOOL m_fStarted;
+ BOOL m_fAppDomainCreated; // this flag is used when an appdomain can only create a single appdomain
// Helpers for both ICLRRuntimeHost2 and ICLRPrivRuntime
HRESULT _CreateAppDomain(
// *** ICorRuntimeHost methods ***
-CorHost2::CorHost2()
+CorHost2::CorHost2() : m_fFirstToLoadCLR(FALSE), m_fStarted(FALSE), m_fAppDomainCreated(FALSE)
{
LIMITED_METHOD_CONTRACT;
-
- m_fStarted = FALSE;
- m_fFirstToLoadCLR = FALSE;
- m_fAppDomainCreated = FALSE;
}
static DangerousNonHostedSpinLock lockOnlyOneToInvokeStart;
// No point going further if the runtime is not running...
// We use CanRunManagedCode() instead of IsRuntimeActive() because this allows us
// to specify test using the form that does not trigger a GC.
- if (!(g_fEEStarted && CanRunManagedCode(LoaderLockCheck::None))
- || !m_fStarted
- )
+ if (!(g_fEEStarted && CanRunManagedCode(LoaderLockCheck::None)))
{
return HOST_E_CLRNOTAVAILABLE;
}
return HOST_E_INVALIDOPERATION;
// No point going further if the runtime is not running...
- if (!IsRuntimeActive() || !m_fStarted)
+ if (!IsRuntimeActive())
{
return HOST_E_CLRNOTAVAILABLE;
}
CONTRACTL_END;
// No point going further if the runtime is not running...
- if (!IsRuntimeActive()
- || !m_fStarted
- )
+ if (!IsRuntimeActive())
{
return HOST_E_CLRNOTAVAILABLE;
}
{
// No point going further if the runtime is not running...
- if (!IsRuntimeActive()
- || !m_fStarted
- )
+ if (!IsRuntimeActive())
{
return HOST_E_CLRNOTAVAILABLE;
}
if(wszMethodName == NULL)
return E_INVALIDARG;
- if (!m_fStarted)
- return HOST_E_INVALIDOPERATION;
-
BEGIN_ENTRYPOINT_NOTHROW;
BEGIN_EXTERNAL_ENTRYPOINT(&hr);
if (1 == refCount)
{
// Stop coreclr on unload.
- m_fStarted = FALSE;
EEShutDown(FALSE);
}
else