# HG changeset patch # User Rik # Date 1428507265 25200 # Node ID 0f1a722133f4c528ff90042e7d8409b65e100252 # Parent d7b1999f055412a996cfb979474e3f84913e70cd 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. diff -r d7b1999f0554 -r 0f1a722133f4 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Wed Apr 08 08:19:28 2015 -0700 +++ b/libinterp/corefcn/graphics.cc Wed Apr 08 08:34:25 2015 -0700 @@ -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; } }