K
Kyle Teague
I have a list of pointers to structs as a private member of a class.
If I call begin() in the same function as I added the data then no
access violation occurs. However, if I try to call begin() in a member
function of the same class I get a memory access violation.
For example:
// this is fine, no error
void CBase::FuncA( void ) {
plugin_info_t *plugin_info = new plugin_info_t;
plugin_info->pPluginSend = ProcPluginSend;
plugin_info->pGetUserList = 0;
lstPlugins.push_back(plugin_info);
list<plugin_info_t*>::iterator i;
i = lstPlugins.begin();
}
// this causes an access violation
void CBase::FuncB( void ) {
list<plugin_info_t*>::iterator i;
i = lstPlugins.begin();
}
If I call begin() in the same function as I added the data then no
access violation occurs. However, if I try to call begin() in a member
function of the same class I get a memory access violation.
For example:
// this is fine, no error
void CBase::FuncA( void ) {
plugin_info_t *plugin_info = new plugin_info_t;
plugin_info->pPluginSend = ProcPluginSend;
plugin_info->pGetUserList = 0;
lstPlugins.push_back(plugin_info);
list<plugin_info_t*>::iterator i;
i = lstPlugins.begin();
}
// this causes an access violation
void CBase::FuncB( void ) {
list<plugin_info_t*>::iterator i;
i = lstPlugins.begin();
}