QueueManager::Ptr QueueManagerPool::borrowObject() { Poco::FastMutex::ScopedLock lock(_mutex); if (!_pool.empty()) { Poco::SharedPtr<TimedQueueManager> pObject = _pool.back(); _pool.pop_back(); return activateObject(pObject->value()); } if (_size < _peakCapacity) { QueueManager::Ptr pObject = _factory->createObject(); activateObject(pObject); _size++; return pObject; } return 0; }
CPixmap* CScene::setPixmap(const QPixmap& pixmap) { if (m_pixmap == 0) { m_pixmap = new CPixmap(this); addItem(m_pixmap); activateObject(m_pixmap); connect(m_pixmap, SIGNAL(signalActivate(CObject*)), this, SLOT(slotObjectActivate(CObject*))); //connect(m_pixmap, SIGNAL(signalDeleted(CObject*)), this, SLOT(slotObjectDeleted(CObject*))); }