Open GoogleCodeExporter opened 9 years ago
While thinking about general solution using this workaround in
talk_base::MessageQueue::Get()
...
if (MQID_DISPOSE == pmsg->message_id) {
ASSERT(NULL == pmsg->phandler);
crit_.Leave(); // HACK: locked crit_ will cause a deadlock when called MessageQueueHandler calls Thread::Clear()
delete pmsg->pdata;
crit_.Enter(); // TODO: fix deadlock
continue;
}
Original comment by ser...@comoyo.com
on 1 Sep 2012 at 12:21
better solution is to stash to be deleted objects in a vector and do actual
delete when crit_ is released
Original comment by ser...@comoyo.com
on 14 Feb 2013 at 10:12
Fixed in r311:
2 seanegan if (MQID_DISPOSE == pmsg->message_id) {
311 mallinath@ // Delete the object, but *not inside the crit scope!*.
311 mallinath@ deleter.messages.push_back(*pmsg);
311 mallinath@ // To be safe, make sure we don't return this message.
311 mallinath@ *pmsg = Message();
2 seanegan continue;
2 seanegan }
2 seanegan return true;
Original comment by ser...@comoyo.com
on 22 Jul 2013 at 12:12
Original issue reported on code.google.com by
ser...@comoyo.com
on 1 Sep 2012 at 12:01