Download

CloseProc(P) does not work

Hi guys so im creating a process in an Actor script in the function BeginPlay() like this:

(FProcHandle) P = FPlatformProcess::CreateProc(TEXT(“Wave.exe”), nullptr, true, false, true, nullptr, 0, nullptr, nullptr);

I need to close this process when i press Stop in the unreal engine so to do that i wrote the following code in the function BeginDestroy():

FPlatformProcess::CloseProc(P);

But it doesn’t close the process even though i am sure when i press Stop, the code runs the function BeginDestroy(). I am sure of it because i logged a text in this function which it successfully does.

Can anyone tell me why it doesn’t close the Process?

This look like one of those old API things that are there but doesn’t really work anymore.
Try:



FPlatformProcess::**TerminateProc**(P);


Works perfectly thank you so much :smiley: