Re: HTML Editor
Re: HTML Editor
- Subject: Re: HTML Editor
- From: Creed Erickson <email@hidden>
- Date: Fri, 6 Jun 2003 10:56:09 -0700
You are creating NSDate objects at an incredible rate. Each time you
ask the thread to sleep, you leak another NSDate.
Try:
myDate = [NSDate dateWithTimeIntervalSinceNow:0.001];
[NSThread sleepUntilDate: myDate ]
release myDate;
where myDate is declared somewhere as "myDate *NSDate"
This should stop the leaking, but there certainly would seem to be
better, more efficient ways of doing pausing a thread for a bit. Have
you considered just using usleep? (See man 1 usleep.)
On Friday, June 6, 2003, at 09:42 AM, Chuck Rice wrote:
I have a thread defined that runs async to the rest or my program to
keep a USB attached LDC display updated with current status
information. Works great, except for this huge memory leak! :( The
memory leak goes away if I comment out this line in the code:
[NSThread sleepUntilDate:[NSDate
dateWithTimeIntervalSinceNow:0.001]];
With this line active I get a 10 to 20 Meg memory leak every minute. I
am still an obj-C newbie, so forgive me if it is obvious. -Chuck-
--
Fight Spam! Join CAUCE! == http://www.cauce.org/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
---
Creed Erickson <email@hidden>
"The early bird gets the worm, but the second mouse gets the cheese."
-- unknown
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.