Avoid crashes when destroying wxGLCanvas

Block signals that are not safe to process any more.
This commit is contained in:
dsr
2021-01-25 21:44:17 -05:00
committed by Vadim Zeitlin
parent d046a8fbc6
commit 2cf57fda36
2 changed files with 8 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ public:
const wxString& name = wxGLCanvasName, const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette); const wxPalette& palette = wxNullPalette);
~wxGLCanvas();
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
const wxGLAttributes& dispAttrs, const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,

View File

@@ -377,6 +377,12 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent,
Create(parent, id, pos, size, style, name, attribList, palette); Create(parent, id, pos, size, style, name, attribList, palette);
} }
wxGLCanvas::~wxGLCanvas()
{
// Avoid sending further signals (i.e. if deleting the current page)
m_qtWindow->blockSignals(true);
}
bool wxGLCanvas::Create(wxWindow *parent, bool wxGLCanvas::Create(wxWindow *parent,
const wxGLAttributes& dispAttrs, const wxGLAttributes& dispAttrs,
wxWindowID id, wxWindowID id,