Fix leaks/crashes related to window scrollbars in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1135
This commit is contained in:
committed by
Vadim Zeitlin
parent
dfe0c27842
commit
fc65bd92a6
@@ -73,6 +73,11 @@ class wxQtInternalScrollBar : public wxQtEventSignalHandler< QScrollBar, wxWindo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxQtInternalScrollBar(wxWindowQt *parent, wxWindowQt *handler );
|
wxQtInternalScrollBar(wxWindowQt *parent, wxWindowQt *handler );
|
||||||
|
~wxQtInternalScrollBar()
|
||||||
|
{
|
||||||
|
disconnect( this, &QScrollBar::actionTriggered, this, &wxQtInternalScrollBar::actionTriggered );
|
||||||
|
disconnect( this, &QScrollBar::sliderReleased, this, &wxQtInternalScrollBar::sliderReleased );
|
||||||
|
}
|
||||||
void actionTriggered( int action );
|
void actionTriggered( int action );
|
||||||
void sliderReleased();
|
void sliderReleased();
|
||||||
void valueChanged( int position );
|
void valueChanged( int position );
|
||||||
@@ -263,6 +268,16 @@ wxWindowQt::~wxWindowQt()
|
|||||||
m_qtWindow->blockSignals(true);
|
m_qtWindow->blockSignals(true);
|
||||||
// Reset the pointer to avoid handling pending event and signals
|
// Reset the pointer to avoid handling pending event and signals
|
||||||
QtStoreWindowPointer( GetHandle(), NULL );
|
QtStoreWindowPointer( GetHandle(), NULL );
|
||||||
|
if ( m_horzScrollBar )
|
||||||
|
{
|
||||||
|
QtStoreWindowPointer( m_horzScrollBar, NULL );
|
||||||
|
m_horzScrollBar->deleteLater();
|
||||||
|
}
|
||||||
|
if ( m_vertScrollBar )
|
||||||
|
{
|
||||||
|
QtStoreWindowPointer( m_vertScrollBar, NULL );
|
||||||
|
m_vertScrollBar->deleteLater();
|
||||||
|
}
|
||||||
// Delete QWidget when control return to event loop (safer)
|
// Delete QWidget when control return to event loop (safer)
|
||||||
m_qtWindow->deleteLater();
|
m_qtWindow->deleteLater();
|
||||||
m_qtWindow = NULL;
|
m_qtWindow = NULL;
|
||||||
|
Reference in New Issue
Block a user