This may be a bit of beginner type of question; however, hypothetically, if there is method that takes a pointer of class type A, how would you free to allocation from a call such as this...
void method123(A *ptr) {<stores the A pointer in a data structure>}
method123(new A());
Is there a way to free the allocation made by that 'new' without deleting the pointer itself that was stored into the data structure?