Questions tagged [resource-leak]
191 questions
0
votes
4 answers
Android sensor unregistration
I am confused about the unregistration of sensor listener. Suppose I forget to unregister a listener. What happens after the application is destroyed?
Will the Android OS keep sending message to the application? But the application is destroyed, and…
![](../../users/profiles/660496.webp)
andrew
- 795
- 2
- 7
- 16
0
votes
1 answer
GDI+ object leak (font, brush)
I encounter GDI font and brush leaks in my application. How can I find the created (and note disposed) objects in my source code?
I do not have any toHFont calls and all access to Graphics is encapsuled in a using statement. I know its brush and…
![](../../users/profiles/573870.webp)
ZoolWay
- 5,071
- 4
- 35
- 69
0
votes
1 answer
GDI object leak on refocus in cairo or gtk on windows?
I have a program (gummi) that uses cairo, poppler, and gtk+. Every time I switch focus with alt-tab (but not so much when I change focus using other means), task manager tells me that it gains 10-20 GDI objects. GDIView tells me that these are…
![](../../users/profiles/377022.webp)
Jason Gross
- 5,363
- 1
- 21
- 53
0
votes
2 answers
When should I free the native (Android NDK) handles?
I have to use a native library (this is not my decision). The library already has a JNI wrapper, and the example Android NDK code works. But the library initialization routines return native handles and the developer is required to correctly close…
![](../../users/profiles/755804.webp)
18446744073709551615
- 14,600
- 3
- 82
- 116
-1
votes
2 answers
How to Clear Resource Leaks?
I have a Java code that I have been testing, the code uses the scanner class without closing it. I know that this causes memory leaks and that the memory that was occupied by the scanner resources during the code execution is still occupied by the…
![](../../users/profiles/13971639.webp)
TheeeFoxxx
- 1
- 1
-1
votes
1 answer
Potential Resource Leak in Return
I'm trying to return the value of PreparedStatement from a method and Because of that I cannot enclose statements in the method with try catch. Is there any way I can get rid of the resource leak of PreparedStatement with return statement?
public…
![](../../users/profiles/6897758.webp)
Lishani
- 37
- 5
-1
votes
1 answer
IntentReciever leak on orientation change
I have registered SMS_RECIEVED broadcastreceiver in CustomWebView. I've taken care of registering and unregistering of receiver on activity's life cycle. All works well until orientation changes.
I've tried placing register/unregister reciever under…
![](../../users/profiles/2530623.webp)
Bhupesh
- 437
- 1
- 9
- 20
-1
votes
3 answers
Prevent GDI leaks in dll
There is a graphical library which is used in a dll, loaded into a process. It seems the library leaks (during loading/unloading several times GDI handle count in the Process Explorer property dialog constantly grows for the whole process).
Is there…
![](../../users/profiles/259731.webp)
noober
- 4,429
- 11
- 45
- 82
-2
votes
0 answers
Dispose AssemblyCatalog object in c#
I have a below code, I want to dispose AssemblyCatalog object
AggregateCatalog _catalog = new AggregateCatalog();
string lstrDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var files =…
![](../../users/profiles/8663636.webp)
Kalyani Reddy
- 81
- 7
-2
votes
1 answer
Distance Formula showing "Resource leak: 'scan' is never closed"
import java.util.Scanner;
//distance = square root of [(x2-x1)squared + (y2-y1)squared + (z2-z1)squared]
public class FirstCode
{
static double distance(double x1, double y1, double z1, double x2, double y2, double z2)
{
return…
![](../../users/profiles/5999320.webp)
Balaram M
- 1
- 3
-2
votes
1 answer
char Memory Leak in Java
I am getting a big memory leak from char. This is not my writing and I am not good at cleaning up memory so help would be appreciated. This class uses char so I will start with it.
package server.util;
import java.text.NumberFormat;
import…
![](../../users/profiles/904671.webp)
Aleksandr
- 29
- 6