Partial revert of 3c6bb0ed8b and
57aed703d2.
When registering an object that was previously unregistered but not yet
garbage collected, the activeChildren count on the parent node was not
incremented, which could result in other registered objects disappearing
after a later unregisterObject.
Copying objects in the tree is not free, but it's not expensive enough
or used frequently enough to justify that error-prone logic. It's much
safer to simply remove objects immediately.
Change-Id: I3dc59c2ebd07b237518424fcd8ea7371a22d6d15
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>