Crash upon exit?

  • Thread starter Thread starter Fredrik Melin
  • Start date Start date
F

Fredrik Melin

Hi,

I have a problem with my app, sometimes (1 out of 10 or so) when the user
closes the app, it crashes (not visiable) but stays as a task in the
background.

This of course doesnt work good with my liveupdate function that cannot
overwrite the files when this has happend. The users ends up having to kill
the process or logoff/login again.

Even for me, in develop mode, the IDE sometimes crashes when I close that
one with my app loaded, I suspect its one of the component in my application
that causes it, but not sure which one.
When it crashes in the IDE it says "memory cannot be read xxxxx" so its not
that much of information.

When it happens for the clients, its not showing any errors at all
(sometimes it does then its the same "Memory cannot be read at xxxx"...

What can I do to find and eliminate this problem? Or is there a workaround?
I do unload all forms, disposing them before, so it must be something
else...

Regards
Fredrik Melin
 
Hi Fred,

Sounds like a pointer reference is screwed up which probably means it is a
bug in one of the components as you say!. Is there no way you can isolate
some of the compenents to try and narrow this down ? Often with this type of
problem the only person who will be able to resolve it is you yourself.

Someone was referring to a free profiler on here in the last two/three days,
I dont know if this might help you track it down. Look through and you will
see it.

Regards - OHM
 
Hi Fredrik,

I think in my opinion the same as OHM, but this does give me some nasty
feeling.
I do unload all forms, disposing them before, so it must be something
else...

Normaly you only have to dispose and unload a dialogform

Can it not be the oposite, if you don't dispose that you don't have the
error and not unload, I think you mean with that last setting them to
nothing.

But it is just a gues in the dark,

Cor
 
Hi Frederik,

I would try it once with not doing that, because that is not the way as it
is described to do, just closing should be enough so that the framework can
delete them using the garbadge collector.

When you get an error, maybe that is the reason of the behaviour what you
get now, but I should not try to fix that with disposing it or setting to
nothing.

As far as I know can disposing direct be used by frequently new created
objects or very large objects.
Your right, I am disposing them and setting them to nothing.

I hope this helps?

Cor
 
Ive look through it the best I can, and I suspect its a instance of IE that
is the problem

In our app, to open a link to a webbpage I use the following code.

(its in a module for global access)
Public ie As SHDocVw.InternetExplorer

Public Sub NavigateToWebPage(ByVal URL As String)

Try
ie = New SHDocVw.InternetExplorer

If (ie Is Nothing) Then
'ie = New SHDocVw.InternetExplorer
ie.Visible = True
Else
If (Not ie.Visible) Then
ie.Visible = True
End If
End If
ie.Navigate(URL)
Catch ex As System.Runtime.InteropServices.COMException
If (ex.Message.ToLower() = "the object invoked has disconnected
from its clients.") Then
ie = New SHDocVw.InternetExplorer
ie.Visible = True
ie.Navigate(URL)
End If
End Try

End Sub


There is no .Dispose on it, so that I cant do when I close the app, If I try
using IE.quit the user get all kinds of strange errors (maybe when the IE is
already closed, havent checked that fully yet)

But I suspect that this is the code that causes the problem.

Any ideas how to cleanup this instance of IE?
Or howto use a better code to open a browser and view a page.
Regards
Fredrik
 
Hi Frederik,

When I look at the code I am asking myself.
Catch ex As System.Runtime.InteropServices.COMException
If (ex.Message.ToLower() = "the object invoked has disconnected
from its clients.") Then
ie = New SHDocVw.InternetExplorer
ie.Visible = True
ie.Navigate(URL)
End If
End Try
What happens as the exception is thrown by something else than with that
ex.message?

Would it not need some action also?

Just a thought

Cor
 
Back
Top