[qt] Fix crash on the example app when launching multiple windows

We need to have a valid context when destroying QMapboxGL.
This commit is contained in:
Thiago Marcos P. Santos
2018-04-25 15:20:31 -07:00
parent 4344812ef5
commit 0eb58278f2
2 changed files with 8 additions and 0 deletions

View File

@@ -22,6 +22,13 @@ MapWindow::MapWindow(const QMapboxGLSettings &settings)
setWindowIcon(QIcon(":icon.png"));
}
MapWindow::~MapWindow()
{
// Make sure we have a valid context so we
// can delete the QMapboxGL.
makeCurrent();
}
void MapWindow::selfTest()
{
if (m_bearingAnimation) {

View File

@@ -29,6 +29,7 @@ class MapWindow : public QGLWidget
public:
MapWindow(const QMapboxGLSettings &);
~MapWindow();
void selfTest();