[Jprogramming] win32 platimg
bill lam
bbill.lam at gmail.com
Sun Feb 10 17:14:35 HKT 2008
I think that VariantClear is used to for variant that created by VariantInit in
oleautomation and not meant to release an arbitrary com object. I believe that
the only documented way to release an object is to call obj->vtbl->Release but
not IUNKNOWN::Release.
Oleg Kobchenko wrote:
> On further reflection, a different and hopefully
> better method is used now: VariantClear with VT_UNKNOWN
> that should call ->Release().
>
> It is now in the media/platimg addon in JAL
> both in j601 and j602.
>
> Thank you for finding and helping to resolve this.
>
> --- bill lam <bbill.lam at gmail.com> wrote:
>
>> On further debugging on both wine and winxp, I found that STR being aliased so
>> that its value actual changed after calling,
>> GdipCreateBitmapFromStream ({.STR);BMP
>> so the value passed to OleRelease was not the original {.STR but some unrelated
>> memory pointer. wine honestly executed OleRelease so there was a memory fault
>> while winxp seemed did nothing.
>>
>> Finally I saved value of {.STR first,
>>
>> PSTR=. {.STR
>> GdipCreateBitmapFromStream PSTR;BMP
>> ...
>> coRelease PSTR NB. call PSTR->vtbl->release
>>
>> This works for both wine and winxp.
>>
>> You may further test if PSTR->vtbl->release not executed, will there be any
>> memory leak.
>>
>> bill lam wrote:
>>> Oleg Kobchenko wrote:
>>>> I thought OleRelease would do (this)->lpVtbl->Release.
>>>>
>>>> I cannot find the sources for OleRelease
>>>> http://source.winehq.org/source/dlls/olecli32/
>>>>
>>>> Any ideas?
>>>>
>>>> To call release as described is possible in j602
>>>> with built-in pcall or using general/pcall addon.
>>> Not sure what OleRelease exactly does but (this)->lpVtbl->Release should
>>> be the correct way to release an interface in COM.
>>>
>>> Did you find any example source code that use OleRelease?
>>>
>>> I conjecture that OleRelease in win32 platimg (under native window) is a
>>> no-op.
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
> ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list