https://bugzilla.novell.com/show_bug.cgi?id=707114
https://bugzilla.novell.com/show_bug.cgi?id=707114#c11 --- Comment #11 from Jonathan Pryor <jonpr...@vt.edu> 2011-08-02 21:04:03 UTC --- Based on the code and description, it does appear to be a "premature" collection, as ABPerson doesn't contain a reference to ABAddressBook, so the GC won't know that the ABPerson reference depends upon the ABAddressBook instance. A good way to test to see if this is the case would be to change AddressBook.cs CollectContacts() to do: var addressBook = new ABAddressBook(); var person = addressBook.GetPeople()[0]; // better have at least one person... addressBook.Dispose(); _allContacts.Add (new Contact { FirstName = person.FirstName }); As for how to fix this, I'm not sure. We could add an ABRecord.AddressBook property to keep the ABAddressBook alive, but we'd need to take care to set this property within ABAddressBook.GetPeople() and any other method that creates a new ABRecord subclass. This would also be adding a member that doesn't exist in the underlying API; I'm not sure if this would be desirable. On a related note, the ABAddressBookCreate() docs explicitly state: http://developer.apple.com/library/ios/#documentation/AddressBook/Reference/ABAddressBookRef_iPhoneOS/Reference/reference.html#//apple_ref/doc/uid/TP40007099 "Important: You must ensure that an instance of ABAddressBookRef is used by only one thread." If the GC is run on a different thread, this could be bad. :-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - mono-bugs@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-bugs