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 ?

Looking quickly at the implementation of VCLUnoHelper::GetInterface,
Window::GetComponentInterface, by the pWindow ends up with a reference
to XWindowPeer so when the awt::XWindow goes out of scope it has no
effect on pWindow. i.e. Window has shared ownership of the interface
reference, the interface reference above doesn't solely own the
underlying vcl Window.

C.


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

Reply via email to