My application stays alive in the process list after closing T-T
-
Hi, there I've created a window application consisting of one form, one user control, and 3 classes. After building it, I tried running the exe file directly and it worked fine. However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager). When I tried running it again, another process of the same name appeared in the process list. Running it multiple times brought up multiple processes. I believe that's because the application is not really terminated. I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method. Anyone got any idea about this? Please help me fix it or my application will eat up all the user's resources. T-T Thank you very much. KiT
-
Hi, there I've created a window application consisting of one form, one user control, and 3 classes. After building it, I tried running the exe file directly and it worked fine. However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager). When I tried running it again, another process of the same name appeared in the process list. Running it multiple times brought up multiple processes. I believe that's because the application is not really terminated. I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method. Anyone got any idea about this? Please help me fix it or my application will eat up all the user's resources. T-T Thank you very much. KiT
-
Hi, there I've created a window application consisting of one form, one user control, and 3 classes. After building it, I tried running the exe file directly and it worked fine. However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager). When I tried running it again, another process of the same name appeared in the process list. Running it multiple times brought up multiple processes. I believe that's because the application is not really terminated. I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method. Anyone got any idea about this? Please help me fix it or my application will eat up all the user's resources. T-T Thank you very much. KiT
Hi, The reason you're probably having this is because you're calling GC.SuppressFinalize(this). From msdn: GC.SuppressFinalize Method Objects that implement the IDisposable interface can call this method from the IDisposable.Dispose method to prevent the garbage collector from calling Object.Finalize on an object that does not require it. I'd advice against implementing IDisposable if you aren't using unmanaged resources or threads anyway, the garbage collection usually handles itself quite well anyway. Good luck!
-
Hi, there I've created a window application consisting of one form, one user control, and 3 classes. After building it, I tried running the exe file directly and it worked fine. However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager). When I tried running it again, another process of the same name appeared in the process list. Running it multiple times brought up multiple processes. I believe that's because the application is not really terminated. I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method. Anyone got any idea about this? Please help me fix it or my application will eat up all the user's resources. T-T Thank you very much. KiT
Are you creating any threads by yourself? If true, you need to set the IsBackground[^] property of those threads to <code>true</code>. Otherwise, those threads will remain alive and will prevent your process from dying.
Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | WinMacro
-
Hi, there I've created a window application consisting of one form, one user control, and 3 classes. After building it, I tried running the exe file directly and it worked fine. However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager). When I tried running it again, another process of the same name appeared in the process list. Running it multiple times brought up multiple processes. I believe that's because the application is not really terminated. I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method. Anyone got any idea about this? Please help me fix it or my application will eat up all the user's resources. T-T Thank you very much. KiT
did you tried application.end this usually happens when you call some form from another form and just hide the base form or some thread in back ground is still working it will be a better option to debug your application :):)
It is Good to be Important but! it is more Important to be Good
-
Hi, The reason you're probably having this is because you're calling GC.SuppressFinalize(this). From msdn: GC.SuppressFinalize Method Objects that implement the IDisposable interface can call this method from the IDisposable.Dispose method to prevent the garbage collector from calling Object.Finalize on an object that does not require it. I'd advice against implementing IDisposable if you aren't using unmanaged resources or threads anyway, the garbage collection usually handles itself quite well anyway. Good luck!
I've tried removing all the implementation of IDisposable. However, it doesn't solve the problem. Thank you very much. KiT
-
which IDE are you using? vc# 2005 express does start a ApplicationName.vhost.exe when opening the solution and restarts the process if you kill it manually - try to kill it manually and check if it is started again :P
I'm using VS2005 and it does start AppName.vhost.exe. Killing each process can really terminate the app. However, that's what I need to solve: not to have to end it manually. Thank you very much. KiT
-
did you tried application.end this usually happens when you call some form from another form and just hide the base form or some thread in back ground is still working it will be a better option to debug your application :):)
It is Good to be Important but! it is more Important to be Good
I have only one form and not calling any other forms. But I do calling some classes and a user control. Where to set Application.end? Thank you very much. KiT
-
I have only one form and not calling any other forms. But I do calling some classes and a user control. Where to set Application.end? Thank you very much. KiT
at formclosing event or where ever you want to close your app :):)
It is Good to be Important but! it is more Important to be Good
-
Hi, there I've created a window application consisting of one form, one user control, and 3 classes. After building it, I tried running the exe file directly and it worked fine. However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager). When I tried running it again, another process of the same name appeared in the process list. Running it multiple times brought up multiple processes. I believe that's because the application is not really terminated. I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method. Anyone got any idea about this? Please help me fix it or my application will eat up all the user's resources. T-T Thank you very much. KiT
I've run into similiar circumstances. I have the forms running on seperate threads and I also have a thread running a formless message loop. When the form closed, the application didn't shutdown because the other thread was still running. Try calling Application.Exit() when the form closes. It's probably not that simple, but I'd thought I'd pass on my 2-cents worth.