Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: malloc/free problems within a thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc/free problems within a thread




On Jul 29, 2006, at 5:58 PM, Bill Bumgarner wrote:

It sounds like you are trashing memory somewhere or you have an object in an autorelease pool in one thread that is being accessed after the pool is released, likely in a different thread (since your error messages are changing).

That's probably what's happening but I'm not sure how to fix it.

I'm scanning a large folder hierarchy on a server that takes quite awhile to execute (avg 12 minutes) and I want the machine to be usable while this is going on in the background. I'm adding and removing objects to a mutable array allocated in the init method from the thread. Is this what's doing it? If so, how would I keep some of the objects found inside the context of the thread once it exits? Do something like this?

[myMutableArray performSelectorOnMainThread: @Selector(addObject:) withData: someData]

Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >malloc/free problems within a thread (From: Ken Tozier <email@hidden>)
 >Re: malloc/free problems within a thread (From: Bill Bumgarner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.