Re: OTFindAndRemoveLink debugging
Re: OTFindAndRemoveLink debugging
- Subject: Re: OTFindAndRemoveLink debugging
- From: Quinn <email@hidden>
- Date: Tue, 19 Mar 2002 10:25:24 +0000
At 12:22 +0100 15/3/02, Stiphane Sudre wrote:
What kind of reason can lead to a crash in OTFindAndRemoveLink?
There are only two reasons I can think of.
1. The list is corrupt (ie one of the fNext pointers points to garbage).
2. Your callback is crashing.
The code for OTFindAndRemoveLink is pretty simple, in fact so simple
that I've included it below.
OTLink* OTFindAndRemoveLink(OTList* list,
OTListSearchProcPtr proc,
const void* ref)
{
OTLink* prev = (OTLink*)&list->fHead;
OTLink* next;
while ( (next = prev->fNext) != NULL )
{
if ( (*proc)(ref, next) )
{
prev->fNext = next->fNext;
return next;
}
prev = next;
}
return NULL;
}
You didn't tell me which platform (Mac OS 9 vs Mac OS X) you're
having troubles with. This is the code from Mac OS 9. A quick
v-diff with the Mac OS X code indicates that it's virtually identical.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.