fixed the macros for delete and memory leak in scenario 2.