AvocadoSoftware.com

Software For Hardcore Developers
Welcome to AvocadoSoftware.com Sign in | Join | Help
in Search

Derick Baileys old blog archives - go to derickbailey.com for new contents

Always call .Dispose on an object that provides .Dispose

I can't tell you how many times I've stressed this to myself and to my co-workers. And wouldn't you know it - I spent the last 8 hours... an entire working day... tracking down a bug in my PocketPC, Compact Framework app. In the end, it was all because I forgot to call .Dispose on an API object.

FYI: Symbol 9000w handheld scanner device, running PocketPC. I was calling the Symbol API object: Symbol.WirelessLAN.Radio to get the Signal.Percent signal strength percentage. I added the .Dispose to my Radio object, and it's workin fine now.

Private Sub SetRadioLevel()

Dim r As Symbol.WirelessLAN.Radio

Try

r = New Symbol.WirelessLAN.Radio

prgSignalStrength.Value = r.Signal.Percent

Finally

If Not r Is Nothing Then

r.Dispose()

End If

End Try

End Sub

Published Tuesday, May 10, 2005 6:52 PM by dredge
Filed Under: ,
New Comments to this post are disabled

This Blog

Post Calendar

<May 2005>
SuMoTuWeThFrSa
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

Advertisement

News

this is my old blog archives - go to http://derickbailey.com for updates

Syndication

Advertisement

Powered by Community Server, by Telligent Systems