Readjusting the amount of external allocated memory in the Canvas destructor