Skip to content

Commit

Permalink
fix: avoid changing class outside of GIL
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Jan 27, 2021
1 parent 683faf2 commit 628dc7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/pybind11/iostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ class pythonbuf : public std::streambuf {

pywrite(line);
pyflush();

// Placed inside gil_scoped_aquire as a makeshift mutex
// to reduce MSVC issues
setp(pbase(), epptr());
}

setp(pbase(), epptr());
}
return 0;
}
Expand Down

0 comments on commit 628dc7c

Please sign in to comment.