當前位置: 首頁>>代碼示例>>C++>>正文


C++ CFPlugInRemoveInstanceForFactory函數代碼示例

本文整理匯總了C++中CFPlugInRemoveInstanceForFactory函數的典型用法代碼示例。如果您正苦於以下問題:C++ CFPlugInRemoveInstanceForFactory函數的具體用法?C++ CFPlugInRemoveInstanceForFactory怎麽用?C++ CFPlugInRemoveInstanceForFactory使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CFPlugInRemoveInstanceForFactory函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: IUnknownRelease

/* =============================================================================
    Name:	IUnknownRelease()
	Description:
        This function takes a tick from a plugin instance's reference count.
		When the reference count goes down to zero the object self-destructs.
	Input Parameters:
        obj			-	The 'this' pointer.
	Output Parameters:
        None.    Return Value:
        ULONG		-	Updated value of the reference count, or zero
                        in case of an error.
* ========================================================================== */
static ULONG IUnknownRelease(void* obj)
{
    IUnknownInstance* instance = (IUnknownInstance*) obj;
    ULONG refCount = 0;
    
    // We can't do much with errors here since we can only return
    // updated reference count value.
    if (instance != NULL)
    {
	// Get updated refCount value (should be under mutex):
	// Make sure refCount is non-zero:
	if (0 == instance->refCount)
	{
	    instance = NULL;
	    return(refCount);
	}

	refCount = --instance->refCount;
	
	// Is it time to self-destruct?
	if (0 == refCount)
	{	    
	    // Unregister 'instance for factory' with CoreFoundation:
	    CFPlugInRemoveInstanceForFactory(instance->factoryID);														
	    // Release used factoryID:				
	    CFRelease(instance->factoryID);
	    instance->factoryID = NULL;
	    
	    // Deallocate object's memory block:
	    free((void*) instance);
	    instance = NULL;
	}
    }    
    return refCount;    
}
開發者ID:fruitsamples,項目名稱:App,代碼行數:47,代碼來源:PageSetupPDE.c

示例2: _deallocCFPlugType

static void _deallocCFPlugType(CFPlugType *myInstance)
{
	CFUUIDRef factoryID = myInstance->_factoryID;
	free(myInstance);
	if (factoryID) {
		CFPlugInRemoveInstanceForFactory(factoryID);
		CFRelease(factoryID);
	}
}
開發者ID:iSound,項目名稱:PlayerPRO,代碼行數:9,代碼來源:CFPlugin-DigitalBridge.c

示例3: DeallocMetadataImporterPluginType

//	Utility function that deallocates the instance when
//	the refCount goes to zero.
//      In the current implementation importer interfaces are never deallocated
//      but implement this as this might change in the future
void DeallocMetadataImporterPluginType(MetadataImporterPluginType *thisInstance)
{
    CFUUIDRef theFactoryID = thisInstance->factoryID;
    free(thisInstance);
    if (theFactoryID)
	{
        CFPlugInRemoveInstanceForFactory(theFactoryID);
        CFRelease(theFactoryID);
    }
}
開發者ID:ksmcardle,項目名稱:Alkor,代碼行數:14,代碼來源:main.c

示例4: DeallocSampleCMPluginType

// -----------------------------------------------------------------------------
//	DeallocSampleCMPluginType
// -----------------------------------------------------------------------------
//	Utility function that deallocates the instance when
//	the refCount goes to zero.
//
static void DeallocSampleCMPluginType( SampleCMPluginType* thisInstance )
{
	CFUUIDRef	theFactoryID = thisInstance->factoryID;
	free( thisInstance );
	if ( theFactoryID )
	{
		CFPlugInRemoveInstanceForFactory( theFactoryID );
		CFRelease( theFactoryID );
	}
}
開發者ID:arnelh,項目名稱:Examples,代碼行數:16,代碼來源:SampleCMPlugin.c

示例5: CFPlugInRemoveInstanceForFactory

void IOHIDIUnknown::factoryRelease()
{
    if (1 == factoryRefCount--) {
        CFUUIDRef factoryId = kIOHIDDeviceFactoryID;
    
        CFPlugInRemoveInstanceForFactory(factoryId);
        CFRelease(factoryId);
    }
    else if (factoryRefCount < 0)
        factoryRefCount = 0;
}
開發者ID:MomandDad,項目名稱:netbook-installer,代碼行數:11,代碼來源:IOHIDIUnknown.cpp

示例6: DeallocMetadataImporterPluginType

// -----------------------------------------------------------------------------
//	DeallocKoanLogImporterMDImporterPluginType
// -----------------------------------------------------------------------------
//	Utility function that deallocates the instance when
//	the refCount goes to zero.
//      In the current implementation importer interfaces are never deallocated
//      but implement this as this might change in the future
//
void
DeallocMetadataImporterPluginType (MetadataImporterPluginType *instance)
{
    CFUUIDRef factoryID = instance->factoryID;

    free (instance);
    if (factoryID)
    {
        CFPlugInRemoveInstanceForFactory ((CFUUIDRef) instance);
        CFRelease (instance);
    }
}
開發者ID:stesla,項目名稱:koan,代碼行數:20,代碼來源:Main.c

示例7: _deallocMyType

    // Utility function that deallocates the instance when
    // the refCount goes to zero.
    static void _deallocMyType(MyType * obj) {
#if PRINTDEBUG
        printf("JAS: _deallocMyType\n");
#endif

        CFUUIDRef factoryID = obj->_factoryID;
        free(obj);
        if (factoryID) {
            CFPlugInRemoveInstanceForFactory(factoryID);
            CFRelease(factoryID);
        }
    }
開發者ID:briancline,項目名稱:jackosx,代碼行數:14,代碼來源:JackRouter.cpp

示例8: Dealloc

/*****************************************************************************
 * Dealloc
 * - 
 * Much like Obj-C dealloc this method is responsible for releasing any object
 * this plugin is holding. Unlike ObjC, you call directly free() instead of 
 * [super dalloc].
 *****************************************************************************/
static void Dealloc(BonjourUserEventsPlugin* plugin)
{
	CFUUIDRef factoryID = plugin->_factoryID;
	
	if (factoryID)
	{
		CFPlugInRemoveInstanceForFactory(factoryID);
		CFRelease(factoryID);
	}
	
	if (plugin->_tokenToBrowserMap)
		CFRelease(plugin->_tokenToBrowserMap);
	
	if (plugin->_browsers)
		CFRelease(plugin->_browsers);
	
	if (plugin->_onAddEvents)
		CFRelease(plugin->_onAddEvents);
	
	if (plugin->_onRemoveEvents)
		CFRelease(plugin->_onRemoveEvents);
	
	if (plugin->_whileServiceExist)
		CFRelease(plugin->_whileServiceExist);
	
	if (plugin->_timers)
	{
		CFIndex i;
		CFIndex count = CFArrayGetCount(plugin->_timers);
		CFRunLoopRef crl = CFRunLoopGetCurrent();
		
		for (i = 0; i < count; ++i)
		{
			CFRunLoopTimerRef timer = (CFRunLoopTimerRef)CFArrayGetValueAtIndex(plugin->_timers, i);
			CFRunLoopRemoveTimer(crl, timer, kCFRunLoopCommonModes);
		}
		
		CFRelease(plugin->_timers);
	}
	
	free(plugin);
}
開發者ID:benvanik,項目名稱:mDNSResponder,代碼行數:49,代碼來源:BonjourEvents.c

示例9: CFPlugInRemoveInstanceForFactory

void
SATSMARTClient::sFactoryRelease ( void )
{

    if ( sFactoryRefCount-- == 1 )
    {

        CFUUIDRef factoryID = kIOATASMARTLibFactoryID;

        CFPlugInRemoveInstanceForFactory ( factoryID );
        CFRelease ( factoryID );

    }

    else if ( sFactoryRefCount < 0 )
    {
        sFactoryRefCount = 0;
    }

}
開發者ID:eitschpi,項目名稱:OS-X-SAT-SMART-Driver,代碼行數:20,代碼來源:SATSMARTClient.cpp

示例10: Dealloc

/*****************************************************************************
* Dealloc
* -
* Much like Obj-C dealloc this method is responsible for releasing any object
* this plugin is holding. Unlike ObjC, you call directly free() instead of
* [super dalloc].
*****************************************************************************/
static void Dealloc(BonjourUserEventsPlugin* plugin)
{
    CFUUIDRef factoryID = plugin->_factoryID;

    if (factoryID)
    {
        CFPlugInRemoveInstanceForFactory(factoryID);
        CFRelease(factoryID);
    }

    if (plugin->_tokenToBrowserMap)
        CFRelease(plugin->_tokenToBrowserMap);

    if (plugin->_browsers)
        CFRelease(plugin->_browsers);

    if (plugin->_onAddEvents)
        CFRelease(plugin->_onAddEvents);

    if (plugin->_onRemoveEvents)
        CFRelease(plugin->_onRemoveEvents);

    free(plugin);
}
開發者ID:thenewwazoo,項目名稱:Community-mdnsResponder,代碼行數:31,代碼來源:BonjourEvents.c

示例11: CFPlugInRemoveInstanceForFactory

HP_HardwarePlugIn::~HP_HardwarePlugIn()
{
	CFPlugInRemoveInstanceForFactory(mFactoryUUID.GetCFObject());
}
開發者ID:abscura,項目名稱:audiounitjs,代碼行數:4,代碼來源:HP_HardwarePlugIn.cpp

示例12: CFPlugInRemoveInstanceForFactory

//------------------------------------------------------------------------------
// IOHIDEventSystemStatistics::IOHIDEventSystemStatistics
//------------------------------------------------------------------------------
IOHIDEventSystemStatistics::~IOHIDEventSystemStatistics()
{
    CFPlugInRemoveInstanceForFactory( _factoryID );
    CFRelease( _factoryID );
}
開發者ID:wzw19890321,項目名稱:IOHIDFamily,代碼行數:8,代碼來源:IOHIDEventSystemStatistics.cpp


注:本文中的CFPlugInRemoveInstanceForFactory函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。