Initializing Local Objects to Acquire Resources

An exception could preclude the operation of code that would normally release a resource (such as memory or a file), thus causing a resource leak that prevents other programs from acquiring the resource. One technique to resolve this problem is to initialize a local object to acquire the resource. When an exception occurs, the destructor for that object will be invoked and can free the resource.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset