Add an element disposal function.