Avoid undefined behavior: delete twice

it's an undefined behavior and sometimes will cause eecheck fail.