Does an Application ever fully close in .NET??

  • Thread starter Thread starter Ebrahim
  • Start date Start date
E

Ebrahim

I have made several applications (not all are done yet) using the .NET
framework but none of them seem to close well with the
Application.Exit function. I use Windows.XP so when i do a Processes
check they still remain in memmory after the function has been called
?
Since they are still bieng read from the .NET env it doesnt matter
much , but if i run the EXE file then there is no way to actually exit
the Application unless I end it manually from the Task Manager.
Does any one have a remedy for this??
 
Ebrahim said:
I have made several applications (not all are done yet) using the .NET
framework but none of them seem to close well with the
Application.Exit function. I use Windows.XP so when i do a Processes
check they still remain in memmory after the function has been called
?
Since they are still bieng read from the .NET env it doesnt matter
much , but if i run the EXE file then there is no way to actually exit
the Application unless I end it manually from the Task Manager.
Does any one have a remedy for this??

Could you post a short but complete example which demonstrates the
problem? It usually occurs if you have some foreground threads still
running which you don't really want to be running any more.
 
Curious. I have not observed this problem.

I assume these are windowed applications that include Application.Run() to
start the action and Application.Exit() to end it.

Technically, Application.Exit() ends the message loop which is started by
Application.Run(). Execution then proceeds from Application.Run() to the
end of the program.
 
Only time i have notice this is when i have other threads still running.
My solution was to follow a ShutDown pattern for all my threads. As part
of the shutdown of any given thread it calls the shutdown method on any
child thread they may have spawned. Do a google search to find out more
about shutdown patterns.

Hope this helps
Leon Lambert
 
Back
Top