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:
parent
c8d02de3db
commit
3747705a43
1 changed files with 5 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue