memory: fix mismatched delete operator