[renderer] Added virtual destructor to writer to fix leak.