Class A {
Int a
};
Class B: public A {
Int b;
Int c;
};
A * aa=new B;
The delete aa;
The code above, inquire of such word memory leak will happen? B in B, c is the destructor is responsible for the resource is returned to the kernel?
CodePudding user response:
No NEW, there would be no memory leak, the release of member variables, it is automatically completed