Re: Search Kit memory use
Re: Search Kit memory use
- Subject: Re: Search Kit memory use
- From: Jesse Grosjean <email@hidden>
- Date: Sat, 22 Nov 2003 07:39:24 -0500
When I use SearchKit it seems to be leaking memory. Basically every
time I index a new document 7 new SKDocumentRef's get created and when
I release the index only one of those SKDocumentRef's gets releases, so
I'm left leaking 6 SKDocumentRef's.
My code for adding a document looks like this:
indexRef = SKIndexCreateWithURL(url, NULL, kSKIndexInvertedVector,
NULL);
...
SKDocumentRef documentRef =
SKDocumentCreateWithURL((CFURLRef)[NSURL fileURLWithPath:path]);
BOOL result = SKIndexAddDocument(indexRef, documentRef, NULL, YES);
CFRelease(documentRef);
...
CFRelease(indexRef);
The path points to a .txt file. These 3 lines seem to create 7
SKDocuments and when I later release the index the index is correctly
released and one SKDocumentRef is released, but the remaining 6 of them
stick around. In ObjectAlloc I see that each of the 7 SKDocuments are
created with this stack trace.
malloc_zone_malloc
_CFRuntimeCreateInstance
DocKeyCreate
IADocKeyCreate
IADocKeyCreateFromFilePath
SKDocumentCreateWithURL
Am I using the API incorrectly or is this known behavior? Is there a
workaround?
Thanks,
Jesse
_______________________________________________
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.