Skip to content

Closing SW Popup window doesn't dispose it properly #133

@spiriapbergeron

Description

@spiriapbergeron

There's a small logic inversion when closing a SwPopupWindow. This is causing duplicate windows being open when you want to reopen Popup "modeless" windows, when you try to close them yourself by calling Close() in the SwPopupWindow as opposed from pressing the [X] icon.

Also I guess the problem doesn't appear if it's a modal dialogbox because it must get closed.

But since I have a floating windows it was causing big problems.

I see this bug in both Master and Dev (I caught it in Dev).

https://github.com/xarial/xcad/blob/dev/src/SolidWorks/UI/SwPopupWindow.cs

Should be if (!m_IsDisposed), or, more clearly, if (m_IsDisposed == false)

    public override void Close()
    {
        **if (m_IsDisposed)** <----- ouch
        {
            m_IsDisposed = true;
            m_Form.Close();
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions