Process still around after close window

  • Thread starter Thread starter Yechezkal Gutfreund
  • Start date Start date
Y

Yechezkal Gutfreund

I have a little CF project. With a little GUI.

The problem I have is that even after hitting the close box the process
hangs around. How do I know?

If I try the same EXE on a XP Pro box, I can see it in the task lisk. (I can
then kill it).
Oddly enough, killing it on the PDA (via the settings/memory/running) does
not really
kill it.

I assume I am not doing enough in the Forms.Dispose() in the GUI? Correct?

Which of the following things need to be done: (or more)

* close all open net streams
* close all open sockets
* kill all threads
* stop any pending beginReads on the netstreams

If you could be so kind as to put a check by the essential ones (e.g. I
assume that close
a netStream that owns the socket will also close the socket and stop the
pending reads).


--
==================================
Yechezkal Gutfreund
Chief Scientist
Kesser Technical Group, Inc.
==================================
 
That is actual pocket pc behaviour.

To override it and for close to mean close then you have to change
your Public Sub Main function from this

Application.Run(new Form1)

to this

Dim frmForm1 as new Form1
frmForm1.ShowDialog()

I actually use a switch /normal (passed in as a command argument) to
toggle which method I use to create the dialog

Shaun
 
Thank you. But what do you do in the main() method after
doing the showDialog()?

You don't want to the main() routine to exit.

Do you have to put in a Thread.Sleep(Timeout.Infinite)?

(I have done this in some places to hold a thread from exiting).

Or does frmForm1.ShowDialog() never return until the close
button is pressed?

(experimentation will show, but if you know the answer, I am
sure others will also appreciate it)
 
The problem is remaining no matter what I have tried:

1. Using myForm.ShowDialog() instead of Run()
2. Explictly calling Dispose() after the ShowDialog()
3. Confiming that Dispose is called via a MessageBox() in Dispose
4. Aborting all explictly started Threads in the Dispose() method
5. Closing all streams in Dispose().

To quote the George Jetson: "Jane! stop this crazy thing".

--
==================================
Yechezkal Gutfreund
Chief Scientist
Kesser Technical Group, Inc.
==================================
 
Fixed with the help of Alex Feinman.

I had to remove all blocking Accept and Read and Writes so that the threads
could
abort. I/e. blocking i/o will keep a thread from aborting.


--
==================================
Yechezkal Gutfreund
Chief Scientist
Kesser Technical Group, Inc.
==================================
 
Back
Top