Skip to content

Commit

Permalink
doesn't randomly stop working anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaNeverUsed committed Jul 29, 2023
1 parent 9d6c5e5 commit b6b0365
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ODTKRA/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ void start_process(std::string path) {
ShellExecute(NULL, L"open", (LPCWSTR)std::wstring(tempstr.begin(), tempstr.end()).c_str(), NULL, NULL, SW_SHOWDEFAULT);
HWND hWindowHandle;

Sleep(500);

//wait for window to load
std::cout << "Waiting for window to load" << std::endl;
while ((hWindowHandle = get_winhandle((LPCWSTR)L"Oculus Debug Tool")) == NULL) {
Expand Down Expand Up @@ -193,11 +195,16 @@ void parse_args(int argc, char* argv[]) {
}
}

bool threadRunning;

void doToggle() {
threadRunning = true;
start_process(ODTPath);
if (!doKillODTThread)
Sleep(100);
killODT(0);

threadRunning = false;
}

int main(int argc, char* argv[]) {
Expand Down Expand Up @@ -237,8 +244,10 @@ int main(int argc, char* argv[]) {

if (tk - lastIdle < seconds(15))
{
doKillODTThread = true;
refresh_loop = tk;
if (threadRunning) {
doKillODTThread = true;
refresh_loop = tk;
}
}
else
{
Expand Down

0 comments on commit b6b0365

Please sign in to comment.