Merge branch 'wxQt-memory-leaks' of https://github.com/catalinr/wxWidgets

Fix many memory leaks in wxQt port.

See https://github.com/wxWidgets/wxWidgets/pull/1243
This commit is contained in:
Vadim Zeitlin
2019-03-05 23:36:41 +01:00
13 changed files with 71 additions and 81 deletions

View File

@@ -43,7 +43,7 @@ public:
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
// Implementation
QList < QShortcut* > *ConvertShortcutTable( QWidget *parent ) const;
wxVector<QShortcut*> ConvertShortcutTable( QWidget *parent ) const;
bool Ok() const { return IsOk(); }
bool IsOk() const;

View File

@@ -9,6 +9,8 @@
#ifndef _WX_QT_APP_H_
#define _WX_QT_APP_H_
#include <wx/scopedarray.h>
class QApplication;
class WXDLLIMPEXP_CORE wxApp : public wxAppBase
{
@@ -19,9 +21,9 @@ public:
virtual bool Initialize(int& argc, wxChar **argv);
private:
QApplication *m_qtApplication;
wxScopedPtr<QApplication> m_qtApplication;
int m_qtArgc;
char **m_qtArgv;
wxScopedArray<char*> m_qtArgv;
wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxApp );
};

View File

@@ -45,7 +45,7 @@ private:
void UpdateFields();
QStatusBar *m_qtStatusBar;
QList< QLabel* > *m_qtPanes;
wxVector<QLabel*> m_qtPanes;
wxDECLARE_DYNAMIC_CLASS(wxStatusBar);
};

View File

@@ -216,24 +216,24 @@ protected:
private:
void Init();
QScrollArea *m_qtContainer;
QScrollArea *m_qtContainer; // either NULL or the same as m_qtWindow pointer
QScrollBar *m_horzScrollBar;
QScrollBar *m_vertScrollBar;
QScrollBar *m_horzScrollBar; // owned by m_qtWindow when allocated
QScrollBar *m_vertScrollBar; // owned by m_qtWindow when allocated
QScrollBar *QtGetScrollBar( int orientation ) const;
QScrollBar *QtSetScrollBar( int orientation, QScrollBar *scrollBar=NULL );
bool QtSetBackgroundStyle();
QPicture *m_qtPicture;
QPainter *m_qtPainter;
QPicture *m_qtPicture; // not owned
wxScopedPtr<QPainter> m_qtPainter; // always allocated
bool m_mouseInside;
#if wxUSE_ACCEL
QList< QShortcut* > *m_qtShortcuts;
wxQtShortcutHandler *m_qtShortcutHandler;
wxVector<QShortcut*> m_qtShortcuts; // owned by whatever GetHandle() returns
wxScopedPtr<wxQtShortcutHandler> m_qtShortcutHandler; // always allocated
bool m_processingShortcut;
#endif // wxUSE_ACCEL