free the cont data before destroying the cont