Skip to content

Commit

Permalink
Update _done_glewInit only on success
Browse files Browse the repository at this point in the history
  • Loading branch information
devel-chm committed Feb 20, 2017
1 parent 7a81601 commit 7ebeeae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Modern.xs
Expand Up @@ -57,7 +57,8 @@ CODE:
warn("glewInit() called %dX already", _done_glewInit);
}
RETVAL = glewInit();
_done_glewInit++;
if ( !RETVAL )
_done_glewInit++;
OUTPUT:
RETVAL

Expand Down
3 changes: 1 addition & 2 deletions utils/generate-XS.pl
Expand Up @@ -307,8 +307,7 @@ sub generate_glew_xs {
CODE:
if ( ! _done_glewInit ) {
glewExperimental = GL_TRUE;
glewInit();
_done_glewInit++;
glewInit() || _done_glewInit++;
}
XS
if ( $item->{glewtype} eq 'fun' and $glewImpl ) {
Expand Down

0 comments on commit 7ebeeae

Please sign in to comment.