Code Monkey home page Code Monkey logo

Comments (9)

heardrwt avatar heardrwt commented on July 26, 2024

I have been unable to reproduce the issue with ARC enabled and disabled.
Do you have a reproducible test case?

Looking at the code directly everything looks to be in order.

from rhaddressbook.

euanlau avatar euanlau commented on July 26, 2024

I need some time to reduce the test case. Thanks for looking into it.

from rhaddressbook.

euanlau avatar euanlau commented on July 26, 2024

I have figured out what the problem was. I was accessing the same address book instance from more than one GCD queues.
Thanks again for spending time on this!

from rhaddressbook.

heardrwt avatar heardrwt commented on July 26, 2024

Good to hear you worked it out.

from rhaddressbook.

shenberg avatar shenberg commented on July 26, 2024

Why is accessing the same RHAddressBook from multiple threads a problem? Isn't the point of having RHAddressBookThreadMain letting you use the same instance from multiple threads?

from rhaddressbook.

heardrwt avatar heardrwt commented on July 26, 2024

The code should all be / is thread safe, i believe the threading issue that was reported above had more to do with application code not retaining an object correctly.

From the original complaint, calling a method on a deallocated object was throwing an NSZombies exception. ie messaging a deallocated object.

from rhaddressbook.

shenberg avatar shenberg commented on July 26, 2024

Hey,
I'm getting the zombie errors on sending [RHPerson release] to zombies. I have an NSOperationQueue serving 40-50 concurrent operations where I commented out almost all the code, except for the line NSArray *people = [rhAddressBook people]; (rhAddressBook is an RHAddressBook instance, of course).

I'm doing nothing else using the address book, yet somehow the objects get double-freed, and I don't really understand why. The code does look correct (except perhaps for atomicity and memory barriers, but I'm no expert in those matters.

More details: the project uses ARC, I wasn't sure whether 1.0.1 is significantly different than HEAD, so I tried both (same issue), and I also grew suspicious of USE_REF_MAP and USE_PERSON_ID_MAP so I disabled both (no luck there either). Also, when the crashes started it was in an app using RHAddressBook with ARC disabled as a pod, while the app had ARC enabled.

from rhaddressbook.

heardrwt avatar heardrwt commented on July 26, 2024

Could you isolate it to a simple test app so i can reproduce. Thanks. Also, perhaps open a new issue.

Also, be aware that the only thing holding a reference to a person from the returned array is the array. if you release the array, the RHPerson object will also be released. ARC, will helpfully do this releasing of the array for you.

from rhaddressbook.

shenberg avatar shenberg commented on July 26, 2024

Done - it was surprisingly simple to get a working replication.

On Tue, Feb 19, 2013 at 12:49 AM, Richard Heard [email protected]:

Could you isolate it to a simple test app so i can reproduce. Thanks.
Also, perhaps open a new issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-13747541.

from rhaddressbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.