Re: NSCFNumber, no pool in place - just leaking
Re: NSCFNumber, no pool in place - just leaking
- Subject: Re: NSCFNumber, no pool in place - just leaking
- From: Craig Bakalian <email@hidden>
- Date: Mon, 23 Dec 2002 15:55:15 -0500
Hi,
I solved this one. It is new to me. The method was called from a
standard C call, this is why it needed its own release pool, I think..
So it looks like this when all is well ->
-(void)addToneToTones: (unsigned)toneValue
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSNumber *n = [NSNumber numberWithUnsignedInt: toneValue];
[tones addObject: n];
[n release];
[pool release];
}
Was being called by this sucker ->
void MyReadProc(const MIDIPacketList *pktlist, void *refCon, void
*connRefConn)
{
int i, j;
if(outPort != NULL && dest != NULL)
{
MIDIPacket *packet = (MIDIPacket *)pktlist->packet;
for(j = 0; j < pktlist->numPackets; ++j)
{
for(i = 0; i < packet->length; ++i)
{
if(packet->data[i]>=0x80 && packet->data[i] < 0xF0)
{
packet->data[i] = (packet->data[i] & 0xF0) |
channel;
if(packet->data[2] > 0)
{
unsigned t = packet->data[1];
[measureInspector addToneToTones: t];
-here's the call!
}
else if(packet->data[2] == 0 || packet->data[0] ==
128)
{
}
}
}
packet = MIDIPacketNext(packet);
}
MIDISend(outPort, dest, pktlist);
}
}
Craig Bakalian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.