FIX: Interfaces Not Released by _com_ptr_t::CreateInstance() (200292)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q200292 SYMPTOMS
Smart pointers object creation (using _com_ptr_t::CreateInstance() ) does not release interface pointers to local or remote servers on failure.
RESOLUTION
For local and remote servers, use the CoCreateInstance() API instead of the function, _com_ptr_t::CreateInstance(). Then use the smart pointer wrapper to call methods on the object by calling _com_ptr_t::Attach(). Once the smart pointer goes out of scope, Release() is called for the interface pointer.
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 Microsoft Visual C++, version 6.0. REFERENCES
(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Jaganathan Thangavelu, Microsoft Corporation.
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbBug kbfix kbVC600fix KB200292 |
---|
|