Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: All
Feb 26, 1999

Ensuring Proper Cleanup in the Case of an Uncaught Exception

It is implementation-dependent whether the destructors of local objects are invoked when an uncaught exception occurs. To ensure that destructors of local objects are invoked in this case, you can add a catch-all statement in main() like this.
 
int main()
{
  try
  {
    //
Danny Kalev
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap