Skip to content

Commit

Permalink
Working AoT
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Sep 5, 2024
1 parent dc1584a commit 0e1704b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/modules/alwaysontop/AlwaysOnTop/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
{
Logger::trace(L"PowerToys runner exited.");
}
trace.UpdateState(false);
trace.Flush();

Logger::trace(L"Exiting AlwaysOnTop");
PostThreadMessage(mainThreadId, WM_QUIT, 0, 0);
Expand All @@ -72,8 +70,8 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,

Trace::AlwaysOnTop::UnregisterProvider();

trace.UpdateState(false);
trace.Flush();
trace.UpdateState(false);

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ class AlwaysOnTopModuleInterface : public PowertoyModuleIface
Trace::AlwaysOnTop::Enable(false);
}

// Wait for 1.5 seconds for the process to exit to end process correctly and stop etw tracer
WaitForSingleObject(m_hProcess, 1500);

// If process is still running, terminate it
if (m_hProcess)
{
TerminateProcess(m_hProcess, 0);
Expand Down

0 comments on commit 0e1704b

Please sign in to comment.