backport the destroy method from the oldie gist

Going down the memory lane...