Add destructor support for plugins.