>Author: wrowe >Date: Thu Oct 7 09:59:28 2004 >New Revision: 53999 > >Modified: > incubator/httpd/cli/trunk/mod_aspdotnet/mod/mod_aspdotnet.cpp >Log: > > Tighten up the scope for releasing objects, since they should be > freed up before we proceed to announcing any errors we encountered. > >Submitted by: hammett <hammett uol.com.br> > >Modified: incubator/httpd/cli/trunk/mod_aspdotnet/mod/mod_aspdotnet.cpp >============================================================================== >--- incubator/httpd/cli/trunk/mod_aspdotnet/mod/mod_aspdotnet.cpp >(original) >+++ incubator/httpd/cli/trunk/mod_aspdotnet/mod/mod_aspdotnet.cpp Thu >Oct 7 09:59:28 2004 >@@ -307,6 +307,9 @@ > _AppDomain *pDefaultDomain = NULL; > hr = pAppDomainIUnk->QueryInterface(__uuidof(_AppDomain), > (void**)&pDefaultDomain); >+ // Done with pAppDomainIUnk >+ pAppDomainIUnk->Release(); >+ > if (FAILED(hr)) { > ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL, > "mod_aspdotnet: Could not retrieve the .NET default " >@@ -319,8 +322,6 @@ > "application domain _AppDomain interface."); > _com_raise_error(E_NOINTERFACE); > } >- // Done with pAppDomainIUnk >- pAppDomainIUnk->Release(); > > ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, > "mod_aspdotnet: Module initialized .NET default > AppDomain..."); >@@ -332,6 +333,9 @@ > > "PublicKeyToken=9b9b842f49b86351"), > _bstr_t(L"Apache.Web.HostFactory"), > &pObjHandle); >+ // Done with pDefaultDomain >+ pDefaultDomain->Release(); >+ > if (FAILED(hr)) { > ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL, > "mod_aspdotnet: Could not create the .NET interface " >@@ -344,8 +348,6 @@ > "for the Apache.Web.HostFactory."); > _com_raise_error(E_NOINTERFACE); > } >- // Done with pDefaultDomain >- pDefaultDomain->Release(); > > VARIANT vHostFactory; > VariantInit(&vHostFactory); >@@ -362,17 +364,18 @@ > "interface for the Apache.Web.HostFactory."); > _com_raise_error(E_NOINTERFACE); > } >+ > hr = > vHostFactory.pdispVal->QueryInterface(__uuidof(IApacheWebHostFactory), > (void**)&conf->pHostFactory); >+ // Done with vHostFactory >+ VariantClear(&vHostFactory); >+ > if (FAILED(hr)) { > ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL, > "mod_aspdotnet: Could not retrieve the COM interface " > "for the Apache.Web.HostFactory."); > _com_raise_error(hr); > } >- >- // Done with vHostFactory >- VariantClear(&vHostFactory); > > ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, > "mod_aspdotnet: Module initialized HostFactory...");