File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ class pythonbuf : public std::streambuf {
3838 return sync () == 0 ? traits_type::not_eof (c) : traits_type::eof ();
3939 }
4040
41- // This function must be non-virtual to be called in a destructor
42- int _sync () {
41+ int sync () override {
4342 if (pbase () != pptr ()) {
4443 // This subtraction cannot be negative, so dropping the sign
4544 str line (pbase (), static_cast <size_t >(pptr () - pbase ()));
@@ -55,10 +54,6 @@ class pythonbuf : public std::streambuf {
5554 return 0 ;
5655 }
5756
58- int sync () override {
59- return _sync ();
60- }
61-
6257public:
6358
6459 pythonbuf (object pyostream, size_t buffer_size = 1024 )
@@ -73,7 +68,9 @@ class pythonbuf : public std::streambuf {
7368
7469 // / Sync before destroy
7570 ~pythonbuf () override {
76- _sync ();
71+ // Must be fully qualified, since the vtable for the base is loaded
72+ // here, not the child.
73+ pythonbuf::sync ();
7774 }
7875};
7976
You can’t perform that action at this time.
0 commit comments