Sie Ste

Sie Ste

  • NA
  • 196
  • 184.5k

C# program call a second program

Feb 7 2013 5:12 PM
   I am having a C# 2010 windows application call another C# 2008 windows application with the following code:           
String Process_Arguments = null;
eRPT_Process.StartInfo.UseShellExecute = false;
eRPT_Process.StartInfo.FileName = strConsoleAppLocation;
 Process_Arguments = strEncryptedValue + " " + strWebServiceurl + " 1 try";
eRPT_Process.StartInfo.Arguments = Process_Arguments;
eRPT_Process.Start();
eRPT_Process.WaitForExit(1800);
Process_Arguments = null;

My question is the following line of code:
eRPT_Process.WaitForExit(1800);

If this program does not wait for the other program to finish executing, could this make the second program stay in memory for awhile?

Basically the first program calls the second program in a loop. Thus could a thread from the previous call to the second program be running at the same time that another call to the second program is running? If so, could these cause the second program to have a memory leak?
if so how would you solve this problem?

Answers (3)