Resolve Issue

To fix the detected memory error:

Investigate the Issue

The commenting embedded in the find_and_fix_memory_errors.cpp sample file reveals the cause of the Mismatched allocation/deallocation problem: delete is the appropriate deallocation function, not free.

Access an Editor

Double-click the highlighted code in the Source tab to open the find_and_fix_memory_errors.cpp source file in an editor:
Editor

Change the Source Code

  1. Comment free(drawing); and uncomment //delete drawing;.

  2. Save your edits (automatic if you are using the Visual Studio* IDE editor).

  3. Click the result tab to return to the Sources window.

    Note

    The Sources window data is unchanged because it is a snapshot of the source code at the time of analysis.

  4. Click the Summary button to display the Summary window.

Key Terms

Code location


Studio-specific supplemental documentation may be available at <install-dir>\<studio>\documentation\ .

For more complete information about compiler optimizations, see our Optimization Notice.