Questions tagged [resource-cleanup]
188 questions
0
votes
2 answers
closing all the activities, services, threads. etc when exiting an Android app
I am writing an android app that when I run it first time it works fine, but when I try to run it a second time it become shaky. I think maybe a thread or a service that I have started first time still continues to work and the second time that I…

TJ1
- 7,578
- 19
- 76
- 119
0
votes
4 answers
Finally block on Using - Does it fire as in other contexts of Finally?
In some code I routinely work with (and have written a few times), code like the following has been used:
using (StreamWriter sw = new FileWriter(".\SomeFile.txt"))
{
// Perform file IO here...
}
finally
{
sw.Close();
}
I'm familiar with…

Andrew Gray
- 3,756
- 3
- 39
- 75
0
votes
2 answers
How to Create multiple Sockets in a same program.?
I was writing a program that has two sockets bounded to two distinct ports. I have created an object of another program, which is in a separate file(It also has a socket initialized and bounded to a separate port). I get a runtime exception and when…

rutharanga
- 1
- 1
-1
votes
2 answers
C#- Using IClientChannel interface without implementing all methods, and/or without casting in a messy manner
Software Environment Details:
-Visual Studio 2017
-.NET Framework 4.5
We have a WCF Service and WCF Client Library C# library.
In order to adhere to proper coding practices, I want the WCFService that I'm coding to also implement the…

crazyTech
- 1,379
- 3
- 32
- 67
-1
votes
1 answer
reliably kill phantomjs launched in setUpClass if derived class' setUpClass fails
I wrote a SeleniumTestCase class that launches PhantomJS in its setUpClass and kills it in its tearDownClass. However, if a derived class' setUpClass raises an error, the PhantomJS process is left hanging because SeleniumTestCase.tearDownClass…

Andy
- 7,885
- 5
- 55
- 61
-1
votes
1 answer
Responsive batch processing in Java
I like the fact that threads can share some resources but they need to release their private resources in the end. Meantime, some computations may be obsolete and you kill them, using Task Manager. I am looking for the same thing done in one JVM…

Little Alien
- 1
- 8
- 22
-1
votes
1 answer
to clean up on exit or not
I understand that Clean-Up is good thing to do. I also understand OS internals, so if I know my process is terminating then its memory will be freed. But I like to propose different perspective. I am on the lines it is rather BAD idea to free the…
user2783263
-1
votes
1 answer
When using Knockout's foreach binding, do events automatically get cleaned when the view model is updated?
When you write out a section of the DOM using Knockout's foreach binding, and you have events in there (say, using the click binding for example), does Knockout automatically perform cleanup on those if the list in the view model changes and it has…

JL Gradley
- 1,731
- 4
- 14
- 15