I am a bit confused about the real cause of memory leak in this case:
int a(4);
int Pointer_1*;
int Pointer_2* = &a
Pointer_1 = new int;
Pointer_1 = Pointer_2;
I know that the Pointer_1 is in this way overwritten and the pointer to the allocated int is lost. But i still can't understand why it leads to mem lack if the pointer to the allocated object is lost?