Bugfix: prevent the "bad drawable" error when showing the OpenGL canvas. #2015 #2099

This commit is contained in:
Alessandro Ranellucci 2014-06-19 10:27:23 +02:00
parent 41de95fd27
commit 89b2fbbae0

View File

@ -383,8 +383,10 @@ sub InitGL {
sub Render {
my ($self, $dc) = @_;
return unless $self->GetContext;
# prevent calling SetCurrent() when window is not shown yet
return unless $self->IsShownOnScreen;
return unless my $context = $self->GetContext;
$self->SetCurrent($self->GetContext);
$self->InitGL;