Replaced Objc-C delete routine with c-code