Skip to content

Commit dc6281e

Browse files
committed
Fix destructor scope to fix termination test
Instead of calling the destructor explicitly, use braces to scope and use implicit destructor calling.
1 parent 5e48d78 commit dc6281e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

unit/util/piped_process.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ TEST_CASE(
7979
commands.push_back("cmd /c ping 127.0.0.1 -n 6 > nul");
8080
std::chrono::steady_clock::time_point start_time =
8181
std::chrono::steady_clock::now();
82-
piped_processt process(commands);
83-
process.~piped_processt();
82+
{
83+
// Scope restriction to cause destruction
84+
piped_processt process(commands);
85+
}
8486
std::chrono::steady_clock::time_point end_time =
8587
std::chrono::steady_clock::now();
8688
std::chrono::duration<double> time_span =

0 commit comments

Comments
 (0)