Re: does Leaks instrument not work correctly with C++?
Re: does Leaks instrument not work correctly with C++?
- Subject: Re: does Leaks instrument not work correctly with C++?
- From: Ladd Van Tol <email@hidden>
- Date: Sun, 1 Mar 2009 17:50:23 -0800
Are you running this program with the Mac or iPhone SDK?
Perhaps you have "automatic leaks checking" turned off in Instruments?
When I run it, it shows 8 leaks before the program exits.
- Ladd
On Mar 1, 2009, at 7:23 AM, email@hidden wrote:
Xcode version 3.1.2 (that came with the 2.2.1 iPhone SDK)
I tried the leak instrument on my iPhone app and was impressed how
nice it was to use - pointed out two small memory leaks I had missed.
I teach C++ programming at the college level and was thinking about
showing my students how to use it (more and more of them have Macs
and we also have a Mac Mini lab), but it doesn't seem to work well
with C++. Am I doing something wrong or this is a known issue?
Here's a simple program that Leaks does not report any leaks
(although you can tell from ObjectAlloc that the memory usage
continued to grow).
#include <iostream>
using namespace std;
int main (int argc, char * const argv[]) {
int *p;
for (int i=0; i<10; ++i) {
cout << i << endl;
p = new int[256];
sleep(2);
}
return 0;
}
Thanks,
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden