D
Donos
Hello
I have the following declaration in my code,
******************************************************************
struct mHandleObj
{
HANDLE h;
};
std::deque<mHandleObj> m_Hand;
std::deque<mHandleObj>::iterator m_Itr;
******************************************************************
Now in the actual implementation, there is...
******************************************************************
HANDLE hHand = ::CreateEvent(NULL,FALSE,FALSE,NULL);
mHandleObj* pObj = new mHandleObj;
pObj->h = hHand ;
m_Hand.push_back(*pObj );
This is where i push in data to Deque. After this i use the following
code to take data out of Deque.
m_Itr = m_Hand.begin();
mHandleObj& pWro = *m_Itr;
And then i do,
m_Hand.pop_back();
***********************************************************
This works fine in a few loops and after that, what happens is that at
some place the Deque breaks.
There is a memory exception and the debugger goes into some
"dbgheap.c" file which is associated with Visual Studio.
Is there anything wrong in this code?
I have the following declaration in my code,
******************************************************************
struct mHandleObj
{
HANDLE h;
};
std::deque<mHandleObj> m_Hand;
std::deque<mHandleObj>::iterator m_Itr;
******************************************************************
Now in the actual implementation, there is...
******************************************************************
HANDLE hHand = ::CreateEvent(NULL,FALSE,FALSE,NULL);
mHandleObj* pObj = new mHandleObj;
pObj->h = hHand ;
m_Hand.push_back(*pObj );
This is where i push in data to Deque. After this i use the following
code to take data out of Deque.
m_Itr = m_Hand.begin();
mHandleObj& pWro = *m_Itr;
And then i do,
m_Hand.pop_back();
***********************************************************
This works fine in a few loops and after that, what happens is that at
some place the Deque breaks.
There is a memory exception and the debugger goes into some
"dbgheap.c" file which is associated with Visual Studio.
Is there anything wrong in this code?