Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.28 KB

cstring-exception-cleanup.md

File metadata and controls

26 lines (23 loc) · 1.28 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
CString Exception Cleanup | Microsoft Docs
11/04/2016
cpp-windows
reference
C++
CString objects, exceptions
exception handling, cleanup code
28b9ce70-be63-4a0d-92a8-44bbfbc95e83
10
mikeblome
mblome
ghogen

CString Exception Cleanup

In previous versions of MFC, it was important that you clean up CString objects after use. With MFC version 3.0 and later, explicit cleanup is no longer necessary.

Under the C++ exception handling mechanism that MFC now uses, you do not have to worry about cleanup after an exception. For a description of how C++ "unwinds" the stack after an exception is caught, see the try, catch, and throw statements. Even if you use the MFC TRY/CATCH macros instead of the C++ keywords try and catch, MFC uses the C++ exception mechanism underneath, so you still do not need to clean up explicitly.

See Also

Strings (ATL/MFC)
Exception Handling