While accessing a computer I get an access violation error. The error is not consistent and only reproducible while trying to access a huge data. I have 2900 components and for each component I am calling a function. In this function I am accessing a ccompter, while doing this application gets crashed at random position like on 200, 210, 2500 etc. The position in not fixed when it crashes.
This issue is specific to the system with following configuration: Window Server 2003 R2 Xeon CPU , 2.66 ghz 2 GB of RAM
here is my code
XGGraphicAttribute* pAttr = pExtraGraphicInfo->GetAttribute();
if(pAttr)
{
DBAttributes* db_attributes = NULL;
db_attributes = static_cast<DBAttributes*> (pAttr->GetDBAttrib开发者_高级运维utes());
CComPtr<IEPGraphicData> pIEPGraphicData;
if(db_attributes)
{
pIEPGraphicData = db_attributes->GetGraphicData(); // here my app got crashed
}
}
IEPGraphicData* DBAttributes::GetGraphicData () const
{
return m_pIEPGraphicData;
}
Possibilities:
The object returned by GetGraphicData() might not support the IEPGraphicData interface. I would expect the smart pointer assignment to result in a null pointer though, rather than an access violation.
The db_attributes object has been deleted from underneath your feet.
精彩评论