
10 Jun
2009
10 Jun
'09
7:48 p.m.
Pearl Rothman wrote:
I am using Fedora 9, gcc 4.3.0, and boost 1.38.0.
I get the following error when calling the destroyMessage function.
virtual void destroyMessage( Message* msg ) { MessageHook hook(msg); m_message_list.push_back( hook ); }
private: boost::intrusive::list<stockTraderMessageHook> m_message_list; };
Take in care that intrusive containers don't store copies of objects but objects themselves. So in destroyMessage "hook" is going to be destroyed while inserted in m_message_list and that's why you get the assertion. See documentation: http://www.boost.org/doc/libs/1_39_0/doc/html/intrusive/intrusive_vs_nontrus... Maybe you just need std::list instead of intrusive. Best, Ion