I am using function IRichEditOle::GetClipboardData(CHARRANGE *lpchrg, DWORD reco,LPDATAOBJECT *lplpdataobj) to retrieve a clipboard object for a range in edit control. At this step whenever image is retrieved for the range, I could see an increase of 12MB memory for my application (No matter what type & size of image I am retrieving). After doing all my job with the LPDATAOBJECT *, I call Release() on that pointer which decreases the memory by 4MB always. So every step is causing 12MB(acquired) - 4MB(released) = 8MB of memory leak for my application.
Also I have noticed that if I use QueryInterface(...) method instead of GetClipboardData(...)there is absolutely no issues in memory. But then there are some other reasons because of which I have to have GetClipboardData(...) do my job.
I am unable to understand what else is required by me to release the memory acquired or Is it actually a GetClipboardData(...) failure and we can't do anything about it :(. Any pointers would really be helpful.
Thanks in advance!!!