Article ID: 190531 - Last Review: February 24, 2004 - Revision: 4.0 FIX: Calling delete or free() in ATL Causes Access ViolationThis article was previously published under Q190531 SYMPTOMS
When you call the delete operator or free() function in an ATL project, it might cause an access violation if you are running on a multi-processor computer.
CAUSE
ATL provides an implementation of free() in non-debug builds with
_ATL_MIN_CRT defined. The delete operator is also overridden to call
free(). On multi-processor computers, the pointer passed in to free() is
used to calculate an offset to the heap's handle:
RESOLUTION
The implementation of free() needs to be modified in Atlimpl.cpp. One
option to resolve this problem is to just return if the pointer is NULL:
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: 194022 (http://support.microsoft.com/kb/194022/EN-US/ ) INFO: Visual Studio 6.0 Service Packs, What, Where, Why 194295 (http://support.microsoft.com/kb/194295/EN-US/ ) HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed MORE INFORMATION
This bug occurs only under all of the following conditions:
| Article Translations
|
Back to the top
