https://issues.apache.org/ooo/show_bug.cgi?id=122405

            Bug ID: 122405
        Issue Type: DEFECT
           Summary: [sidebar] UI element's real interface is disposed
           Product: General
           Version: AOO400-dev
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: normal
          Priority: P3
         Component: code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
            Blocks: 121420

Created attachment 80743
  --> https://issues.apache.org/ooo/attachment.cgi?id=80743&action=edit
GDB backtrace

Build the custompanel example from the SDK.
Run the example.
Attach the debugger.

Set two break points:
a) on the UI element's disposing()
sd::colortoolpanel::PanelUIElement::disposing()

b) on its tool panel disposing()
sd::colortoolpanel::SingleColorPanel::disposing()

Activate the custompanel on the sidebar, switch to the gallery or the navigator
panel.

sd::colortoolpanel::SingleColorPanel::disposing() is called before
sd::colortoolpanel::PanelUIElement::disposing()

sfx2::sidebar::Panel::Dispose() is disposing the UI element's real interface,
then the UI element itself:


    if (mxElement.is())
    {
        Reference<lang::XComponent> xComponent (mxElement->getRealInterface(),
UNO_QUERY);
        if (xComponent.is())
            xComponent->dispose();
    }

    {    
        Reference<lang::XComponent> xComponent (mxElement, UNO_QUERY);
        mxElement = NULL;
        if (xComponent.is())
            xComponent->dispose();
    }

The real interface of the UI element is the UI element's responsibility (this
means, when the UI element is disposed, it will free its resources, among other
things, disposing its real interface - whatever that could be).
In the custompanel example, this is handled nicely by the C++ component
implementation helper class. In other cases, it may end up in a crash, as with
the Watching Window extension from
http://extensions.openoffice.org/en/project/watchingwindow

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to