No, it's OK to use VariantClear to any properly
created variant. VariantInit just properly zeros
memory and sets type to VT_EMPTY.
VariantClear should exacly call the one and only
correct Release.
Yes, obj->vtbl->Release is the definition
of ((*IUnknown)pobj)->Release.
Does it not work on Wine?
--- bill lam <[EMAIL PROTECTED]> wrote:
> 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 <[EMAIL PROTECTED]> 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
> >
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm