.h file
UIImage *ownImg;
@property (nonatomic, retain) UIImage *ownImg;
.m file
In viewWillAppear method:
UIImage *myImage2 = [UIImage imageNamed:@"thumbnail.png"];
self.ownImg = myImage2;
That is a leak in ownImg, anyone know why it leaking?
BTW, what is the different of using self.ownImg and without the self.
Thanks.
...
I'm getting a bunch of memory leaks for this bit of code in Instruments.
Here:
NSArray *tmpCoords = [loc.mapCoords componentsSeparatedByString:@","];
and Here:
coords.tileRow = [NSString stringWithFormat:@"%d",x];
coords.tileCol = [NSString stringWithFormat:@"%d",y];
Is there a better way to do this? I'm basically parsing ...
Hello everyone,
I have following codes, which have memory leak on device, could you please kindly help check it? Thanks.
@interface NewsListViewController : UIViewController<UITableViewDataSource, UITableViewDelegate> {
@private
UITableView *tableView;
NSFetchedResultsController *fetchedResultsController;
......
}
@property (non...
Hi folks, here is a simple question. Can you help me find the memory leak in this Vala code ?
If it helps I can post the generated c code too ^^
using GLib;
using Gtk;
using Gee;
void test1 ()
{
Gee.ArrayList<Gdk.Pixbuf> list = new Gee.ArrayList<Gdk.Pixbuf>();
for( int a = 0; a < 10000; a++)
{
string path = "/usr...
I want to learn the right way to alloc an uiimage and release it for memory management. When i use the following code it crashes when deallocating, if i dont use [imager release]; program doesnt crash but it shows a leak for imager. Any ideas for solution?
UIImage *imager = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] ...
I have checked all posts here, but can't find a solution for me so far.
I did setup a small service that should only watch if my other services I want to monitor runs, and if not, start it again and place a message in the application eventlog.
The service itself works great, well nothing special :), but when I start the service it use a...
I work with OpenAL to play sounds in my app. When I test it using Instruments tool, it finds a leak:
LeakedObject = GeneralBlock-512
Size = 512 Bytes
Responsible Library = AudioToolbox
Responsible Frame = AU3DMixerEmbeddedInputElement::Initialize()
Stack trace:
0 libSystem.B.dylib malloc
1 libstdc++.6.dylib operator new(unsi...
Hi,
I've recently tracked down a memory leak in my application and I'd like to add a test case to check that it stays that way. What I want to do is this:
int numberOfInstancesBeforeFunction = GetNumberOfInstancesInMemory(typeof(MyClass));
PerformFunction();
GC.Collect();
int numberOfInstancesAfterFunction = GetNumberOfInstances...
My movie player leaks memory only on the iPad and only when the "Done" button is clicked. If the movie plays to completion then it cleans itself up properly. Here is the play code:
mViewPlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[self movieURL:@"mymovie"]];
[self.parentViewController presentModalViewController:mV...
What does the term "Leaky Abstraction" mean? (Please explain with examples. I often have a hard time grokking a mere theory.)
...
I tried 2 different methods of creating a background image for a view controller.
I have researched this before and came to the conclusion that for good memory practice you should use this method:
NSString *path = [[NSBundle mainBundle] pathForResource:@"controllerBackground" ofType:@"png" inDirectory:@""];
[self.view setBackgroundCol...
here I have some code where the Leaks-Instrument detects leaks. The commented Numbers behind some lines taken out from the Leaks-Instrument.
I don't know what I have to do here. I have made many tries, have released and autoreleased, but no solution.
Can somebody show me where the problem is?
- (void) handleDataModel {
int theTag = [...
Instruments leaks says that this code leaks:
NSString *name = [file substringToIndex:i];
Layer *actualLayer = nil;
for (Layer *lay in layers) {
if ([lay.layerName isEqual:name]) {
actualLayer = lay;
}
}
name is the leaking object. There are some strange things: it only leaks sometimes, not always (this snippet of code ...
Hi,
I have a program which suffer from file descriptor increasing.
I see when I execute the command ls -l /proc/5969/fd where 5969 is the pid of the java program the number of file descriptor continuously increasing.
but I am unable to open one of those files decriptors to see what file remains open :
here is an example of the listing :...
While testing application performance, I came across some pretty strange GC behavior. In short, the GC runs even on an empty program without runtime allocations!
The following application demonstrates the issue:
using System;
using System.Collections.Generic;
public class Program
{
// Preallocate strings to avoid runtime allocatio...
Hi,
I'm developing as small diabetes program using Delphi 5 and ADO. I do a little query like this:
function GetLowestGlucoseLevel(StartDate:string;EndDate:string): Integer;
var
Q:TADOQuery;
begin
try
Q:=TADOQuery.Create(Application); //Separate unit, owner set to App
Q.Connection:=dtMod.ADOCon;
Q.DisableControls;...
Hello All,
I have an object that holds a pointer to some malloced memory, when I come to dealloc the object I use the free command to free up the malloced memory, how ever the free command appears to be absolutely doing nothing and I'm getting large memory leaks as a result. I have confirmed that the dealloc command is being executed.
...