← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH]v2 Fix memory leaks with improper wxBaseConfig* usage (model ownership and ownership-transfer with std::unique_ptr)

 

Le 29/06/2016 à 00:37, Michael Steinberg a écrit :
> Hello,
> I removed the "auto" usage, added @todo's and tried to comply with the coding style. If there's
> anything noncompliant left I'd appreciate a pointer!
> 
> Michael
> 

Michael,

I am thinking the change in your patch:

> +
> +    // wxAuiManager doesn't delete managed windows at least in V 3.1
> +    // see wxAuiManager::~wxAuiManager() in framemanager.cpp
> +    delete m_mainToolBar;
> +    delete m_LeftWin;
> +    delete m_Launcher;
> +    delete m_MessagesBox;

is a bug.

These windows are managed by the wxAuiManager, but it is not the owner.
the parent window is the main frame, and their destructor is actually called.

I am thinking the issue could be only for floating toolbars (and other floating widgets) when these
widgets are detached from the main frame, and therefore shown in someting like a miniframe, not
owner-ed by the main frame.

(I had a look at wxAuiManager::~wxAuiManager(), and the destructor try to delete only managed
windows which have no parent (null parent) )

Currently, only the toolbar of the footprint viewer can float.

I did not made tests for the footprint viewer, and I do not know if the issue really exists.

-- 
Jean-Pierre CHARRAS


References