• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OTFindAndRemoveLink debugging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: OTFindAndRemoveLink debugging
      • From: Stéphane Sudre <email@hidden>
References: 
 >OTFindAndRemoveLink debugging (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: Modem Port
  • Next by Date: RE: Non Carbon OT APIs?
  • Previous by thread: OTFindAndRemoveLink debugging
  • Next by thread: Re: OTFindAndRemoveLink debugging
  • Index(es):
    • Date
    • Thread