Mercurial > hg > octave-nkf
diff libinterp/corefcn/graphics.cc @ 20257:0f1a722133f4
Fix deadlock condition on error in drawnow() (bug #44759).
* graphics.cc (Fdrawnow): When an error is encountered, use gh_manager::unlock
to release lock *before* returning from function.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 08 Apr 2015 08:34:25 -0700 |
parents | c66909c234e6 |
children | 10600b2dd3c1 |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -11045,6 +11045,9 @@ else { error ("drawnow: invalid argument, expected 'expose' as argument"); + + gh_manager::unlock (); + return retval; } } @@ -11079,12 +11082,16 @@ { error ("drawnow: empty output ''"); + gh_manager::unlock (); + return retval; } else if (pos_c == std::string::npos) { error ("drawnow: empty pipe '|'"); + gh_manager::unlock (); + return retval; } else if (pos_p != std::string::npos && pos_p < pos_c) @@ -11107,6 +11114,8 @@ error ("drawnow: nonexistent directory '%s'", dirname.c_str ()); + gh_manager::unlock (); + return retval; } }