static void _CFPFactoryDeallocate(_CFPFactory *factory) {
    CFAllocatorRef allocator = factory->_allocator;
    SInt32 c;
    
    _CFPFactoryRemoveFromTable(factory);

    if (factory->_plugIn) _CFPlugInRemoveFactory(factory->_plugIn, factory);

    /* Remove all types for this factory. */
    c = CFArrayGetCount(factory->_types);
    while (c-- > 0) _CFPFactoryRemoveType(factory, (CFUUIDRef)CFArrayGetValueAtIndex(factory->_types, c));
    CFRelease(factory->_types);

    if (factory->_funcName) CFRelease(factory->_funcName);
    if (factory->_uuid) CFRelease(factory->_uuid);

    CFAllocatorDeallocate(allocator, factory);
    CFRelease(allocator);
}
Пример #2
0
static void _CFPFactoryDeallocate(CFTypeRef ty) {
    SInt32 c;
    _CFPFactoryRef factory = (_CFPFactoryRef)ty;
    
    _CFPFactoryRemoveFromTable(factory);

    if (factory->_plugIn) {
        _CFPlugInRemoveFactory(factory->_plugIn, factory);
        CFRelease(factory->_plugIn);
    }
    
    /* Remove all types for this factory. */
    c = CFArrayGetCount(factory->_types);
    while (c-- > 0) _CFPFactoryRemoveType(factory, (CFUUIDRef)CFArrayGetValueAtIndex(factory->_types, c));
    CFRelease(factory->_types);

    if (factory->_funcName) CFRelease(factory->_funcName);
    if (factory->_uuid) CFRelease(factory->_uuid);
}