Implements the destroy action for compilations.