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 {
38
38
return sync () == 0 ? traits_type::not_eof (c) : traits_type::eof ();
39
39
}
40
40
41
- // This function must be non-virtual to be called in a destructor
42
- int _sync () {
41
+ int sync () override {
43
42
if (pbase () != pptr ()) {
44
43
// This subtraction cannot be negative, so dropping the sign
45
44
str line (pbase (), static_cast <size_t >(pptr () - pbase ()));
@@ -55,10 +54,6 @@ class pythonbuf : public std::streambuf {
55
54
return 0 ;
56
55
}
57
56
58
- int sync () override {
59
- return _sync ();
60
- }
61
-
62
57
public:
63
58
64
59
pythonbuf (object pyostream, size_t buffer_size = 1024 )
@@ -73,7 +68,9 @@ class pythonbuf : public std::streambuf {
73
68
74
69
// / Sync before destroy
75
70
~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 ();
77
74
}
78
75
};
79
76
You can’t perform that action at this time.
0 commit comments