Cor,
I've been out of town for a few days.
Have you build it in a component so that I disposable is implemented?
Here is what I think is the relevant code (BTW, while I'm a very
experienced programmer, I'm still fairly new to VB):
==========================================
Class TestData
...
Public WithEvents oIE As SHDocVw.InternetExplorer ' the copy
of IE we automate
...
Sub RunTest()
...
If Not SetupIE() Then Return ' start IE or quit
For Each urle In Me.alURLEntries ' loop through list of
URLs
DoThisURL(urle) ' actually process this URL
Next
Me.oIE.Quit() ' close my IE
OutLogNL("EndTest")
End Sub
Function SetupIE() As Boolean ' create an IE to automate
Try
Me.oIE = New SHDocVw.InternetExplorer ' create teh
IE object
Catch ex As Exception ' die on failure
OutLogNL("Tester: Unable to setup IE " & ex.ToString)
Return False
End Try
Me.oIE.Visible = True ' make IE visible
Return True
End Function
....
End Class
....
Public oTestData As TestData ' the test data
....
Sub Main()
oTestData = New TestData ' create our test data object
GetArguments() ' get all our arguments, into
oTestData
'oTestData.DumpURLs()
OutLogSetup() ' setup our output files
oTestData.RunTest() ' actuall run the test
Cleanup() ' do any cleanup
End Sub
==========================================
While I'm new to VB, my understanding is that this will insure that
all storage will be unallocated when the application terminates so
that I need not explicitly deallocate either oTestData or the
contained objects. Is this correct?
Your question caused me to wonder if I might have memory leaking from
some other source. I explicitly create via New a number of
System.Threading.AutoResetEvent and ArrayList ( and its content). As
above, my understanding is that these need not be explicitly released
when the application terminates.
Finally I create some file I/O handles
Public fsFileLog As StreamWriter ' the log file
Public fsFileOut As StreamWriter ' the output file
but go to some care to insure that they are closed before the program
terminates.
Does any of this appear to be doubtful?
Thanks,
Richard