Add convenient method for custom destructor

(issue #40)