Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFReleasing a ABMutableMultiValueRef



Brian,

Does the "boring stuff" including getting values from the dictionary? If so, make certain none of those values (from CFDictionaryGetValue) is getting released by accident.

Cheers,

--Dave

On May 29, 2006, at 4:55 PM, Brian Ray wrote:

Greetings to those who contain Carbon:

I came across an odd thing:

ABMutableMultiValueRef mutmultivalue = (ABMutableMultiValueRef)
ABRecordCopyValue(person, kABAddressProperty);
int mcount = ABMultiValueCount(mutmultivalue);
for (int i = 0; i < mcount; i++) {
CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(mutmultivalue, i);

///  .... do other boring stuff

// commented out to prevent crash when releasing mutmultivalue
//        CFRelease(dict);
}
CFRelease(mutmultivalue);

When I release the dict and then release mutmultivalue, I get a crash:

#0 0xfffeff18 in objc_msgSend_rtp
#1 0x907538c8 in __CFDictionaryDeallocate
#2 0x9073d554 in _CFRelease
#3 0x907405e0 in __CFArrayReleaseValues
#4 0x90740418 in __CFArrayDeallocate
#5 0x9073d554 in _CFRelease
#6 0x948a3048 in -[ABMultiValue dealloc]
#7 0x04846ec0 in AdrBook2notyahoo::makepersontuple at notyahoo.cpp: 18646


I do not get it. Can any of you who contain Carbon help me out and
tell me what is going on here?

Building with the 10.4u sdk.

Regards,

Brian Ray
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >CFReleasing a ABMutableMultiValueRef (From: "Brian Ray" <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.