Select the OpenGL context when destroying VideoDisplay

This is needed to destroy the correct things when there are multiple
active opengl displays.
This commit is contained in:
Thomas Goyne 2015-10-04 18:19:02 -07:00
parent c8d02de3db
commit 3747705a43
1 changed files with 5 additions and 1 deletions

View File

@ -126,6 +126,7 @@ VideoDisplay::VideoDisplay(wxToolBar *toolbar, bool freeSize, wxComboBox *zoomBo
}
VideoDisplay::~VideoDisplay () {
Unload();
con->videoController->Unbind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this);
}
@ -435,8 +436,11 @@ Vector2D VideoDisplay::GetMousePosition() const {
}
void VideoDisplay::Unload() {
glContext.reset();
if (glContext) {
SetCurrent(*glContext);
}
videoOut.reset();
tool.reset();
glContext.reset();
pending_frame.reset();
}