I have a code in VC++ that gives this particular error on exiting the program while executing in release mode.
Error:
An unhandled exception of type 'System.AccessV iolationExcepti on' occurred in Unknown Module.
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The execution breaks at one of these places:
1. file name oleinit.cpp
[code=cpp]
if (pThread != NULL)
{
// destroy message filter (may be derived class)
delete pThread->m_pMessageFilt er;
pThread->m_pMessageFilt er = NULL; // This is the line where execution breaks
}[/code]
2. File name cmdtarg.cpp
[code=cpp]
CCmdTarget::~CC mdTarget()
{
#ifndef _AFX_NO_OLE_SUP PORT
if (m_xDispatch.m_ vtbl != 0)
((COleDispatchI mpl*)&m_xDispat ch)->Disconnect() ; //This is the line where error is indicated
ASSERT(m_dwRef <= 1);
#endif
m_pModuleState = NULL;
}
[/code]
The same doesnot happen when i execute the program in debug mode. Also when i execute the program throught the executable the exiting doesnot give this error. Can someone please help.
Error:
An unhandled exception of type 'System.AccessV iolationExcepti on' occurred in Unknown Module.
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The execution breaks at one of these places:
1. file name oleinit.cpp
[code=cpp]
if (pThread != NULL)
{
// destroy message filter (may be derived class)
delete pThread->m_pMessageFilt er;
pThread->m_pMessageFilt er = NULL; // This is the line where execution breaks
}[/code]
2. File name cmdtarg.cpp
[code=cpp]
CCmdTarget::~CC mdTarget()
{
#ifndef _AFX_NO_OLE_SUP PORT
if (m_xDispatch.m_ vtbl != 0)
((COleDispatchI mpl*)&m_xDispat ch)->Disconnect() ; //This is the line where error is indicated
ASSERT(m_dwRef <= 1);
#endif
m_pModuleState = NULL;
}
[/code]
The same doesnot happen when i execute the program in debug mode. Also when i execute the program throught the executable the exiting doesnot give this error. Can someone please help.
Comment