So I am trying to fix this really annoying bug. If I filter my array like the ideal version with NSPredicate, I will get EXC_BAD_ACCESS because it tries to call release on the object passed in as the delegate an extra time. If I filter with the working version, it works fine. I thought these two implementations were identical. Where am I...
Let's say I pthread_create and then pthread_detach it. Now, from within the thread function, I malloc some block.
When the thread exits, will the malloc'ed memory be freed automatically?
(been googling for an answer to no avail...)
...
Hey so if I have some property like
@interface MyClass {
NSArray* myArray;
}
@end
@property (retain, nonatomic) NSArray* myArray;
In my init method should I do something like
myArray = [[NSArray array] retain];
Or
self.myArray = [NSArray array];
I would think the former would be preferred as it is more clear what is going on...
I have follwowing peace of code in which I have specified the leaky line . As I am new to iPhone developement I can't understand what actually is wrong with that line . please have a look at that line and tell me .
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
//take away
//NSURL *url1 = [[NSURL alloc] initWithStrin...
What is the difference between the 'delete' and 'dispose' C++ operators with regards to dynamic memory allocation?
...
Hello all,
I am using a private MBProgressHUD
Now I am using the indicator view on my add button in which I am calling my addrecord service .
UIWindow *window = [UIApplication sharedApplication].keyWindow;
HUD = [[MBProgressHUD alloc] initWithWindow:window];
// Add HUD to screen
[window addSubview:HUD];
// Regisete for HUD callb...
I'm trying to make my mex library avoid all memory allocation what so even.
Until now, the mex got an input, created some matrices using mxCreate...() and returned this output.
But now I'd like to modify this interface so that the mex itself would not do any allocations.
What I had in mind is that the mexFunction will get as input the ma...
I am calling a C DLL from a Delphi 2009 application and I keep getting errors when memory allocated by GetMem or AllocMem is passed to the DLL. The only way around I could avoid these errors was by using malloc from msvcrt.dll. What is malloc doing that the built-in memory routines aren't, and how can I get the built-in ones to work? I r...
Windows Server 2008. How can I quickly use up RAM so to induce GC in my app. If there is a way to do it without needing Visual Studio or installing a language runtime it would be good.
EDIT: I don't want to have to write an app and then copy it over to the server. I'm looking for a way to do it quickly without writing an app that requir...
As I try to write
NSLog(@"%d", myObject.myId);
where myId is int, console gives some hight number like 70614496. And when I use @"%@", I get exception -[CFNumber respondsToSelector:]: message sent to deallocated instance 0x466c910.
Why is it so?
Here's definition of myObject:
@interface myObject : NSObject {
int myId;
NSString *titl...
I've got a desktop program. Most Operating Systems run the program in its own address space.
When the program exits, I believe most operating systems free the memory allocated by the program and return it to the memory stack for reuse.
What I am not sure of, is if the program has a memory leak, will the memory "leaked" also be returne...
I am using Core Data for my iPhone app. My attributes are set with retained properties.
For example, a "number" attribute in a "Thing" entity:
#import <CoreData/CoreData.h>
@interface Thing : NSManagedObject
{
}
@property (nonatomic, retain) NSNumber * number;
@end
@implementation Thing
@dynamic number;
@end
When working with...
Hi, I'm having trouble deallocating a UISCrollView that contains images.
There's something wrong with my code, but I cannot understand where.
this is a snippet of my code. It basically create a loops adding a uiscrollview with an image and removing.
If you run the code with instruments, no memory will be freed.
I also add some check for...
I am trying to catch write faults on write protected memory pages from my program. I have done following to achieve this :
protect memory page using mprotect() : allowing only read access
register signal handler for SIGSEGV called write-fault-handler using sigaction()
inside signal handler :
siginfo->si_addr gives me memory addres...
I have been getting a weird memory leak and i just pinpointed what is causing. I am using a utility application that has a main view and a flipside view. When you are on the flipside view you are able to present another modal view by clicking a plus button. This view has a UISearchBar and UITableView. When clicking on the UISearchBar...
Say you have the following ANSI C code that initializes a multi-dimensional array :
int main()
{
int i, m = 5, n = 20;
int **a = malloc(m * sizeof(int *));
//Initialize the arrays
for (i = 0; i < m; i++) {
a[i]=malloc(n * sizeof(int));
}
//...do something with arrays
//How do I fre...
Hi
As my programs involves more and more code Im starting to get a bit frustrated with the error messages that are thrown in the console:
2009-11-14 14:31:57.513 FC[915:5b27] *** -[SearchResultParser respondsToSelector:]: message sent to deallocated instance 0x82d28e0
This one is not the worst as it actually tells me that it has t...
Hi there,
I've read the memory management sections in the Core Data docs and I'm still a little confused. I have one context in my app, and I have several things getting objects out of it. For example a few fetched results controllers, detail views and some other code fetching random objects. Once objects have been fully released and th...
I know that in PHP you don't have to free memory.
Is it reached by garbage collector?
...
My asp.net application is 3 static pages (no database) and it initializes with 48Mb of memory in use.
Can I configure the application to use less memory?
NB: I've already set the memory limits in IIS. I set maximum value for working process to 30 MB of physical memory.
What other ways can I employ to make ASP.NET use less memory...