Support implementing your own dispose and clear