Quantcast
Channel: File Metadata
Viewing all articles
Browse latest Browse all 919

Commented Unassigned: Dispose() RegistryKeys [9478]

$
0
0
Registry keys opened in http://filemeta.codeplex.com/SourceControl/latest#AssociationManager/Extension.cs are never disposed it seems. Is that by design?
Great tool in any case.
Comments: ** Comment from web user: Dijji **

The effect of my not using Dispose will be that underlying Windows resources, such as registry handles, will be held on to until the C# objects are garbage collected. If this code had been in a property handler or part of a server, I would certainly not have considered this as acceptable. However, this is an occasional use client application, and it's hard to think of any problems this might cause.

As a long-time C# programmer, I think of the alternative as involving a try finally block, and cluttering up things more than a very nonthreatening resource release deferral justifies. But trying to bring myself up-to-date, I think the best option of all is probably the using construct. I think that it reflects the usage of underlying resources into code in a very clean way. I have got the code open at the moment anyway for some 1.3 work. Do you think it would be worthwhile to go back and clean this up?

Dijji


Viewing all articles
Browse latest Browse all 919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>