When I checked my application for memory leaks it is showing 12 leaks. What will be the effect of this?
I used global variables as shown below
#import "file1.m"
int num;
#import "file2.m"
extern int num;
num = 10;
Can this cause memory leaks?
Anyone please help. I am a beginner in programming.
I very much doubt it. Memory leaks are dynamic allocations (in other words, run-time allocation rather than compile-time) where you forget to free them. Global variables like
numare supposed to exist for the duration of the executable so they should not be considered a leak.I suspect you’ll have to look elsewhere.
Perhaps if you posted the output from your leak checker, we could help out some more.