Avoid crash in Fl_Gl_Window::make_current() (#1287)
This commit is contained in:
parent
1ba957eb60
commit
0ac7e427a1
@ -118,6 +118,10 @@ int Fl_Gl_Window::mode(int m, const int *a) {
|
|||||||
void Fl_Gl_Window::make_current() {
|
void Fl_Gl_Window::make_current() {
|
||||||
// puts("Fl_Gl_Window::make_current()");
|
// puts("Fl_Gl_Window::make_current()");
|
||||||
// printf("make_current: context_=%p\n", context_);
|
// printf("make_current: context_=%p\n", context_);
|
||||||
|
// The following line prevents potential crashes when make_current() is
|
||||||
|
// called before show(). Applications should call show() before
|
||||||
|
// make_current() for proper initialization.
|
||||||
|
if (!shown()) return;
|
||||||
pGlWindowDriver->make_current_before();
|
pGlWindowDriver->make_current_before();
|
||||||
if (!context_) {
|
if (!context_) {
|
||||||
mode_ &= ~NON_LOCAL_CONTEXT;
|
mode_ &= ~NON_LOCAL_CONTEXT;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user