Home > OS >  Objects on the heap to process end of the process, how to release?
Objects on the heap to process end of the process, how to release?

Time:09-19

1, when the user closes a process, the actual process after what?
2, when the user closes a process crashes, what are the possible reasons?
3, OS should also can only reclaim memory, and can't call the heap object's destructor?
4, the following tests, why the object's destructor is able to be performed?
Class A
{
Public:
~ (A)
{
STD: : cout & lt; & lt; "Destroy!" & lt; & lt; STD: : endl;
}
}

Int main ()
{
A * A=new A ();
return 0;
}

CodePudding user response:

Why you need to adjust the destructor, direct the whole address space back not to go

CodePudding user response:

reference 1st floor akari10032 response:
why you need to adjust the destructor, the whole address space take not to go directly to the
such as an object destructor must write file records, when the direct recovery of memory and the destructor does not perform, of course, no
  • Related