DeclanRussell / NvidiaAIDenoiser

A simple implementation of Nvidia's AI denoiser
MIT License
398 stars 52 forks source link

denoiser.exe is not exiting after "done!" #13

Closed comsyspro closed 5 years ago

comsyspro commented 5 years ago
  1. Why the denoiser.exe does not exit after it has done the denoising? I'm using Windows 7 and the program doesn't exit at the end.

  2. How can one compile your github code with Visual Studio? Can you please write a little instruction, so I can compile it myself on a Windows 7 system.

comsyspro commented 5 years ago

If anyone got the same problem, here I fixed it with an exit function:

#include <thread>
#include <chrono> 

void exitfunc()
{
    HANDLE tmpHandle = OpenProcess(PROCESS_ALL_ACCESS, TRUE, GetCurrentProcessId());
    if (NULL != tmpHandle)
    {   
        std::cout<<"terminating..."<<std::endl;
        std::this_thread::sleep_for(std::chrono::seconds(1)); // delay 1s
        TerminateProcess(tmpHandle, 0);
    }
    exit(EXIT_SUCCESS);
}
DeclanRussell commented 5 years ago

This has baffled me for a while. Thanks for the work around! I'll add it to the main repo.