Process still around after close window

  • Thread starter Yechezkal Gutfreund
  • 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.
==================================
 
S

Shaun Wilde

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
 
Y

Yechezkal Gutfreund

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)
 
Y

Yechezkal Gutfreund

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.
==================================
 
Y

Yechezkal Gutfreund

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.
==================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top