mirror of https://github.com/odrling/Aegisub
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
|
@ -126,6 +126,7 @@ VideoDisplay::VideoDisplay(wxToolBar *toolbar, bool freeSize, wxComboBox *zoomBo
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoDisplay::~VideoDisplay () {
|
VideoDisplay::~VideoDisplay () {
|
||||||
|
Unload();
|
||||||
con->videoController->Unbind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this);
|
con->videoController->Unbind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,8 +436,11 @@ Vector2D VideoDisplay::GetMousePosition() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoDisplay::Unload() {
|
void VideoDisplay::Unload() {
|
||||||
glContext.reset();
|
if (glContext) {
|
||||||
|
SetCurrent(*glContext);
|
||||||
|
}
|
||||||
videoOut.reset();
|
videoOut.reset();
|
||||||
tool.reset();
|
tool.reset();
|
||||||
|
glContext.reset();
|
||||||
pending_frame.reset();
|
pending_frame.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue