Skip to content

Commit e763f04

Browse files
committed
Base class destructor should be virtual
Fixes #1401
1 parent ce9d6e2 commit e763f04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_virtual_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ExampleVirt {
1717
ExampleVirt(int state) : state(state) { print_created(this, state); }
1818
ExampleVirt(const ExampleVirt &e) : state(e.state) { print_copy_created(this); }
1919
ExampleVirt(ExampleVirt &&e) : state(e.state) { print_move_created(this); e.state = 0; }
20-
~ExampleVirt() { print_destroyed(this); }
20+
virtual ~ExampleVirt() { print_destroyed(this); }
2121

2222
virtual int run(int value) {
2323
py::print("Original implementation of "

0 commit comments

Comments
 (0)