Improved object lifecycle tracking and fix leaks.
23 files changed