HRESULT CDebugLog::Create(IApplicationContext *pAppCtx, LPCWSTR szAsmName, CDebugLog **ppdl) { HRESULT hr = S_OK; CDebugLog *pdl = NULL; _ASSERTE(szAsmName && ppdl); *ppdl = NULL; pdl = NEW(CDebugLog); if (!pdl) { hr = E_OUTOFMEMORY; goto Exit; } hr = pdl->Init(pAppCtx, szAsmName); if (FAILED(hr)) { SAFEDELETE(pdl); goto Exit; } *ppdl = pdl; Exit: return hr; }
HRESULT CDebugLog::Create(IApplicationContext *pAppCtx, LPCWSTR pwzAsmName, CDebugLog **ppdl) { HRESULT hr = S_OK; CDebugLog *pdl = NULL; if (!pwzAsmName || !pAppCtx) { hr = E_INVALIDARG; goto Exit; } *ppdl = NULL; pdl = NEW(CDebugLog); if (!pdl) { hr = E_OUTOFMEMORY; goto Exit; } hr = pdl->Init(pAppCtx, pwzAsmName); if (FAILED(hr)) { delete pdl; pdl = NULL; goto Exit; } *ppdl = pdl; Exit: return hr; }