Do not leak the list of panes

This commit is contained in:
Cătălin Răceanu
2019-02-26 23:13:12 +02:00
parent c6354696d4
commit 595a9945b5
2 changed files with 4 additions and 3 deletions

View File

@@ -10,6 +10,8 @@
#include "wx/statusbr.h"
#include <QtCore/QScopedPointer>
class QLabel;
class QStatusBar;
@@ -45,7 +47,7 @@ private:
void UpdateFields();
QStatusBar *m_qtStatusBar;
QList< QLabel* > *m_qtPanes;
QScopedPointer< QList<QLabel*> > m_qtPanes; // should this really be a pointer?
wxDECLARE_DYNAMIC_CLASS(wxStatusBar);
};

View File

@@ -48,7 +48,7 @@ bool wxStatusBar::Create(wxWindow *parent, wxWindowID WXUNUSED(winid),
long style, const wxString& WXUNUSED(name))
{
m_qtStatusBar = new wxQtStatusBar( parent, this );
m_qtPanes = new QList < QLabel* >;
m_qtPanes.reset(new QList<QLabel*>());
if ( style & wxSTB_SIZEGRIP )
m_qtStatusBar->setSizeGripEnabled(true);
@@ -106,7 +106,6 @@ void wxStatusBar::Refresh( bool eraseBackground, const wxRect *rect )
void wxStatusBar::Init()
{
m_qtStatusBar = NULL;
m_qtPanes = NULL;
}
void wxStatusBar::UpdateFields()