OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000640OMNeT++simulation kernelpublic2013-03-21 10:342013-03-21 10:34
0000640: Destructor of cOwnedObject may invoke undefined behaviour if object is owned
If a cOwnedObject is deleted and has an owner and this owner is not the default list, the method ownedObjectDeleted() on cObject throws a cRuntimeError exception. Throwing exceptions from destructors may invoke undefined behaviour - on the platform I'm working it results in abort() called without having a chance to see the message from the exception.

The cOwnedObject destructor should catch the exception, print the message and either return (in which case the error of deleting an owned object translates into a warning) or exit the simulation. In no case it should allow to propagate the exception outside the destructor.
See section 15.2 of C++11, clause 3, especially the note. I don't have a reference to C++03 at hand but something equaivalent is there too.
No tags attached.
Issue History
2013-03-21 10:34HartiNew Issue

There are no notes attached to this issue.