Caolán McNamara wrote:
So, as a contrived example...

void foo()
{
  ::Window* pWindow = new WorkWindow(NULL,WB_STDWORK),
  ::com::sun::star::uno::Reference<com::sun::star::awt::XWindow> xWindow
    = VCLUnoHelper::GetInterface(pWindow);
}

Will that end up leaking pWindow or not ? It does, right ?

It sure does. The the GettInterface implementation is this way for historical reasons (like so much); WorkWindow got created plain C++ all the time, then came UNO and one occasionally needed a fitting XWindow interface. Which did NOT get ownership, because that still belonged to the one calling new and delete.

Just my 2 cents, pl

--
Sanity is just a bad excuse for a lack of imagination.
     -- Author unknown

Registered Office: Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Commercial register of the Local Court of Munich: HRB 161028
Managing Directors: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Chairman of the Supervisory Board: Martin Häring

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@gsl.openoffice.org
For additional commands, e-mail: dev-h...@gsl.openoffice.org

Reply via email to