void BMISensorBundleActivator::deactivateBundle()
{
    std::vector< BundleResource::Ptr >::iterator itor;
    for (itor = m_vecResources.begin(); itor != m_vecResources.end();)
    {
        destroyResource(*itor);
    }
}
	void ResourceManagerBase::destroy(void)
	{ 
		for (auto iter = m_resources.begin(), end = m_resources.end(); iter != end; ++iter)
		{
			Resource* resource = iter.value();
			ASSERT(resource->isEmpty());
			destroyResource(*resource);
		}
		m_resources.clear();
	}
	void ResourceManagerBase::removeUnreferenced()
	{
		Array<Resource*> to_remove(m_allocator);
		for (auto* i : m_resources)
		{
			if (i->getRefCount() == 0) to_remove.push(i);
		}

		for (auto* i : to_remove)
		{
			m_resources.erase(i->getPath().getHash());
			destroyResource(*i);
		}
	}
Esempio n. 4
0
//////////////////////////////////////////////////////////////////////////
// destroyContext
//virtual
void RsCoreImplGL::destroyContext( OsClient* pClient )
{
    BcAssert( BcIsGameThread() );
    TContextMapIterator It = ContextMap_.find( pClient );

    if( It != ContextMap_.end() )
    {
        // If we're destroying the default context, NULL it.
        if( ContextMap_[ NULL ] == It->second )
        {
            ContextMap_[ NULL ] = NULL;
        }

        // Destory resource.
        destroyResource( It->second );

        // Erase from context map.
        ContextMap_.erase( It );
    }
}
Esempio n. 5
0
OsStatus MpTopologyGraph::destroyResources(MpResourceTopology& resourceTopology,
                                          int resourceInstanceId)
{
    // Destroy the resources
    int resourceIndex = 0;
    UtlString resourceName;
    OsStatus result;
    while(resourceTopology.getResource(resourceIndex, resourceName)
          == OS_SUCCESS)
    {
         resourceTopology.replaceNumInName(resourceName, resourceInstanceId);
         result = destroyResource(resourceName);
         assert(result == OS_SUCCESS);
         resourceIndex++;
    }

    // Remove virtual ports
    removeVirtualInputs(resourceTopology, TRUE, resourceInstanceId);
    removeVirtualOutputs(resourceTopology, TRUE, resourceInstanceId);

    return OS_SUCCESS;
}
/*
 This method gets called back from the connector whenever a resource is
 lost on the bridged protocol
 */
void UpnpBundleActivator::connectorLostCb(UpnpResource::Ptr pUpnpResource)
{
    destroyResource(pUpnpResource);
}