What is Reference counting in COM?
The Reference counting is a memory management method used to count the number of times an object has a pointer referring to it. The very first time it is created, the reference count is set to 1. When the last reference to the object is nulled, the reference count is set to 0 and the object is deleted. The Care must be exercised to prevent a context switch from changing the reference count at the time of the deletion. In the methods that follow, the syntax is shortened to keep the scope of the discussion short and manageable.