Skip to content

Commit

Permalink
Remove requirement for WaitForSingleObject for termination state
Browse files Browse the repository at this point in the history
  • Loading branch information
eschan145 authored Jan 28, 2025
1 parent d8cf8fe commit 38dae7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ DK_API bool close_application_by_exe(const char* exe_name) {
if (hProcess) {
// Bam, terminated!
TerminateProcess(hProcess, 0);
terminated = true;

auto wait = [&]() {
DWORD result = WaitForSingleObject(hProcess, TIMEOUT);

switch (result) {
case WAIT_OBJECT_0:
terminated = true;
std::cout << "Process " << exe_name
<< " terminated successfully.\n";
break;
Expand Down

0 comments on commit 38dae7b

Please sign in to comment.