[debug] Added class to count objects in memory for debugging
[renderer] Added virtual destructor to writer to fix leak.