Ticket #24 (new defect)

Opened 13 months ago

Last modified 13 months ago

ProxyObject crash when parent is deleted

Reported by: PatrickHorn Owned by: PatrickHorn
Priority: major Milestone:
Component: Object Host (Client) Keywords:
Cc:

Description

Crashes with a "pure virtual function called" for ProxyObjectListener::destroyed(), for the destruction notification of the children of a given parent object.

gdb crashes when trying to print out the proxy object. This is probably a use-after-free.

One possible solution is to make the list of children separate, and use shared_ptr's for them, because it would be nice to permit walking down through the tree, which is currently not possible.

Change History

Changed 13 months ago by danielrh

Not being able to walk up and down the subunit tree was one of the biggest complaints from fellow coders (eg spiritplumber and jacks) in vega strike. We should avoid the mistake this time around
weak pointers up, shared pointers down? or weak both ways?

Changed 13 months ago by PatrickHorn

We currently have ObjectReference?'s up the tree (can be easily changed to weak_ptrs which would both save memory and make lookups more efficient)

Down the tree is currently using the ListenerProvider? interface (with ProxyObject?*, really ProxyObjectListener?*) so the children know when their parent is destroyed in order to update their position.

That can be changed to a set of ProxyObject? pointers (can be shared or plain), giving the ability to traverse the list of children.

Note: See TracTickets for help on using tickets.