AccessibleObjectFromPoint memory leakage problem..
-
Hi, We have used the same code as given in http://blogs.msdn.com/oldnewthing/archive/2004/04/23/118893.aspx to capture objects under mouse in timer.But we are facing memory leakage problem. While debuging this code we got the point of leakage is in function AccessibleObjectFromPoint. We already using IAccesible::Release function and VariantClear to release memory but still memory leakage is there. Any one know ,how to release memory used after AccessibleObjectFromPoint is called. Please help. Thanx in advance. -Jay
-
Hi, We have used the same code as given in http://blogs.msdn.com/oldnewthing/archive/2004/04/23/118893.aspx to capture objects under mouse in timer.But we are facing memory leakage problem. While debuging this code we got the point of leakage is in function AccessibleObjectFromPoint. We already using IAccesible::Release function and VariantClear to release memory but still memory leakage is there. Any one know ,how to release memory used after AccessibleObjectFromPoint is called. Please help. Thanx in advance. -Jay
The leak could be from accessing a member function of
IAccesible
and not freeing its output parameter like theSysFreeString
in the link. You should consider usingATL
classes like CComPtr[^] which is a smart pointer and do not need to be released. Some other useful ATL classes are - CComBSTR[^] CComVariant[^]«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
The leak could be from accessing a member function of
IAccesible
and not freeing its output parameter like theSysFreeString
in the link. You should consider usingATL
classes like CComPtr[^] which is a smart pointer and do not need to be released. Some other useful ATL classes are - CComBSTR[^] CComVariant[^]«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)Hi, Thanx for reply. Actualy we had removed all IAccessible function calls to clear that doubt,So now there is only one function call in timer that AccessibleObjectFromPoint() ,But still there is a memory leakage. If you have any knowledge regarding this please let us know. Thanx again, -Jay