I like the simple new and delete in C++, however, recently, when I tried to write something complicated, it seems that the program is not stable. It said I use delete on a certain memory space twice, however I didn't.
It happens sometimes when I seperate "new" and "delete" in different functions, however, I can guarentee them in pairs, no additional new, no additional delete.
So here's my question, should "new" and "delete" in C++ lies in a same function? What's wrong if they're not?