-
Notifications
You must be signed in to change notification settings - Fork 83
Description
I am looking for memory leaks in a COM application using an own IMallocSpy implementation (difficult to isolate in a small test application) and suspect VARIANT to leak.
If I track following code:
Pointer pVariant = allocate(VARIANT.class);
pVariant.get().setValue("some string");
pVariant.release();
I get following information about the creation of a memory block that subsequently was never freed:
Memory block at address xxx size16 [size is 16 independent from which string was inserted]
org.bridj.cpp.com.OLEAutomationLibrary.VariantChangeType(Native Method) -2
org.bridj.cpp.com.COMRuntime.change(COMRuntime.java:358) 358
org.bridj.cpp.com.COMRuntime.setValue(COMRuntime.java:389) 389
org.bridj.cpp.com.VARIANT.setValue(VARIANT.java:1119) 1119
I should be using BridJ 6.0.2 on a Windows 7 64 bits OS but in a 32 bit Java environment.
Any hint on how to better use VARIANT was welcome - maybe I should call some other method to properly release the memory. I actually just use VARIANT to get a string from a property bag.
Thanks,
Erwin