//theTextPanels is declared like: vector <TBTextPanel> theTextPanels;
TBTextPanel textControl;
theTextPanels.push_back(textControl);
When the push_back is called the following error is shown:
Debug Assertion Failed
File: dbgheap.c
Line: 1044
Expression: crtIsValidHeapPointer(pUserData)
I''ve stripped the TBTextPanel class down so all it contains is its constructor and destructor. The strange thing is that I have another class that I have done the same to but when using push_back on that it works fine.
Also if I make the TBTextPanel inherit from TBControl and then add it to a vector of TBControls it doesn''t throw up an error. But still does if I add it to a vector of TBTextPanels.
All references to this error I have seen while searching seem to relate to deleting pointers etc.
If anyone could help I would be grateful.
Thanks.
Debug Assertion Failed std::vector push_back
Hi all,
I''m having a problem attempting to push an instance of one of my classes onto the end of a vector. The following is the code that causes the problem:
I''m using the default copy constructor/destructor i.e. I haven''t defined one.
It seems strange that I would need to since I don''t have member variables in the TBTextPanel class. Also the program dies before the textControl instance of TBTextPanel is destroyed.
It seems strange that I would need to since I don''t have member variables in the TBTextPanel class. Also the program dies before the textControl instance of TBTextPanel is destroyed.
If you''re using visual studio, you might try a "rebuild all" just in case. Occasionally it has trouble compiling when only parts of your code need recompiling.
"Unfortunatly, when I sent the email, instead of writing "Best Regards" I ended up writing "Best Retards." - boolean
"Unfortunatly, when I sent the email, instead of writing "Best Regards" I ended up writing "Best Retards." - boolean
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement