¿¹Á¦

Class::~Class() {
// Clean up references to memory ...
int error = cleanUp();
if(error)
{
throw str;
}
logDestruction(); // May throw exception
}

¼Ö·ç¼Ç
¿¹¿Ü¸¦ ¸ðµÎ ijġÇÔÀ¸·Î½á È®½ÇÈ÷ ¿¹¿Ü°¡ ¼Ò¸êÀÚ¸¦ ³²±âÁö ¾Êµµ·Ï ÇϽʽÿÀ.

Class::~Class() {
try {
// Clean up references to memory
delete pointer;
logDestruction();
}
catch( ... ) {
// catch all errors here
}
}