fix leak in bpmdelegate