Most voted "dispose" questions
15 questions
Sort by count of
-
29
votes2
answers12489
views -
12
votes2
answers348
viewsShould or should not Httpclient be used within a using block?
Reading this reply, a question relating to the use of using, I was curious about the following statement: In fact everyone uses HttpClient wrong, I even used and did not know everything, because I…
-
10
votes2
answers525
viewsWhen is it recommended that a class implement Idisposable?
I use the IOC standard in my project which facilitates the call of procedure type Resolver.Resolve<IPedido>().GerarPedido(), however, I did not want to leave "loose" in this way, I would like…
-
9
votes2
answers1919
viewsWhen should I use GC.Suppressfinalize()?
In . NET, under what circumstances GC.SuppressFinalize()? What are the advantages of using this method? Obs: I found answer in the SO-en: When should I use GC.Suppressfinalize()? As it had nothing…
-
9
votes2
answers477
viewsWhat types of resources are released in a "using" statement?
According to Microsoft documentation: The using statement provides a convenient syntax that ensures use correct of Idisposable objects. Source. That is, the interface Idisposable provides a…
-
6
votes2
answers413
viewsMemory management and release
1) When I create an object in which there is arrays and large variables, defining them as null, will help in the reduction? Within a method Dispose() - before they were of some value. 2) When I call…
-
6
votes1
answer527
views -
4
votes1
answer87
views -
4
votes2
answers175
viewsShould I make sure the threads end at Dispose?
There are already some questions about the interface IDisposable and the using, for example: What types of resources are released in a statement using I should always use Disposis Still I’m not sure…
-
4
votes2
answers350
viewsWhy is it necessary to close file?
Why is this line required in Java? fout.close(); Context: LinkedList values = new LinkedList(classe.getTurma().values()); if (!values.isEmpty()) { FileOutputStream fout = null; String FILE =…
-
3
votes1
answer203
views -
2
votes2
answers539
viewsContext Dispose should be used in ASP.NET MVC?
In the Web Forms every time I’ve assembled some kind of CRUD, used the using to make an implicit Dispose(). public List<Produtos> Lista () { using (var ctx = new DbContext()) { return ctx.…
-
1
votes1
answer136
viewsFile closure
I need to leave the file free, without getting in use, because it is blocking. Follow the code: StringWriter sw = new StringWriter(); XmlTextWriter tw = new XmlTextWriter(sw);…
-
1
votes0
answers72
viewsHow to release memory in a WPF application in C#?
Well I created a system in WPF and C# and every day that passes it gets bigger, I honestly had never worried about the issue of memory for small applications doesn’t make much difference, but that’s…
-
-1
votes1
answer105
viewsDispose in Unit Of Work
I have a web application and am using repository* and Unit Of Work. In some examples I saw that after performing some change operation in the bank we should call the method Dispose(). I instancei…