Пример #1
0
//virtual
void LLConsole::clear()
{
	mTimer.reset();
	LLMutexLock lock(&mQueueMutex);
	std::for_each(mParagraphs.begin(), mParagraphs.end(), DeletePointer());
	mParagraphs.clear();
	std::for_each(mNewParagraphs.begin(), mNewParagraphs.end(), DeletePointer());
	mNewParagraphs.clear();
}
Пример #2
0
////-----------------
/// FFMultiSet::clear
//---------------------
//	Cleans up.
//
void FFMultiSet::clear()
{
	mConfig = NULL;
	for
	(	int i = 0
	;	i < mSet.size()
	;	i++
	){
		DeletePointer( mSet[ i ] );
	}
	mSet.clear();
	DeletePointer( mDevices );
}
Пример #3
0
// Destroys the object
LLFloaterPay::~LLFloaterPay()
{
	std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer());

	// Clean up if we are still waiting for a name.
	gCacheName->cancelCallback(mTargetUUID,onCacheOwnerName,this);
}
Пример #4
0
LLViewerRegion::~LLViewerRegion() 
{
	if(mHttpResponderPtr)
	{
		(static_cast<BaseCapabilitiesComplete*>(mHttpResponderPtr.get()))->setRegion(NULL) ;
	}

	gVLManager.cleanupData(this);
	// Can't do this on destruction, because the neighbor pointers might be invalid.
	// This should be reference counted...
	disconnectAllNeighbors();
	mCloudLayer.destroy();
	LLViewerPartSim::getInstance()->cleanupRegion(this);

	gObjectList.killObjects(this);

	delete mCompositionp;
	delete mParcelOverlay;
	delete mLandp;
	delete mEventPoll;
	LLHTTPSender::clearSender(mHost);
	
	saveObjectCache();

	std::for_each(mObjectPartition.begin(), mObjectPartition.end(), DeletePointer());
}
Пример #5
0
void LLDrawable::destroy()
{
	if (gDebugGL)
	{
		gPipeline.checkReferences(this);
	}

	if (isDead())
	{
		sNumZombieDrawables--;
	}

	if (LLSpatialGroup::sNoDelete)
	{
		llerrs << "Illegal deletion of LLDrawable!" << llendl;
	}

	std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
	mFaces.clear();
		
	
	/*if (!(sNumZombieDrawables % 10))
	{
		llinfos << "- Zombie drawables: " << sNumZombieDrawables << llendl;
	}*/	

}
Пример #6
0
void LLXferManager::cleanup ()
{
	LLXfer *xferp;
	LLXfer *delp;

	for_each(mOutgoingHosts.begin(), mOutgoingHosts.end(), DeletePointer());
	mOutgoingHosts.clear();

	delp = mSendList;
	while (delp)
	{
		xferp = delp->mNext;
		delete delp;
		delp = xferp;
	}
	mSendList = NULL;

	delp = mReceiveList;
	while (delp)
	{
		xferp = delp->mNext;
		delete delp;
		delp = xferp;
	}
	mReceiveList = NULL;
}
Пример #7
0
LLCacheName::Impl::~Impl()
{
    for_each(mCache.begin(), mCache.end(), DeletePairedPointer());
    mCache.clear();
    for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer());
    mReplyQueue.clear();
}
Пример #8
0
LLBufferArray::~LLBufferArray()
{
	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
	std::for_each(mBuffers.begin(), mBuffers.end(), DeletePointer());

	delete mMutexp;
}
Пример #9
0
LLCurlRequest::~LLCurlRequest()
{
	llassert_always(mThreadID == LLThread::currentID());

	//stop all Multi handle background threads
	for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter)
	{
		LLCurl::Multi* multi = *iter;
		if (multi->mThreaded)
			multi->mSignal->lock();
		multi->mQuitting = true;
		if (multi->mThreaded)
		{
			while (!multi->isStopped())
			{
				multi->mSignal->signal();
				multi->mSignal->unlock();
				apr_sleep(1000);
				multi->mSignal->lock();
			}
		}
		if (multi->mThreaded)
			multi->mSignal->unlock();
	}
	for_each(mMultiSet.begin(), mMultiSet.end(), DeletePointer());
}
Пример #10
0
LLCurl::Multi::~Multi()
{
	llassert(isStopped());

	if (LLCurl::sMultiThreaded)
	{
		LLCurl::Easy::sMultiMutex->lock();
	}

	delete mSignal;
	mSignal = NULL;

	// Clean up active
	for(easy_active_list_t::iterator iter = mEasyActiveList.begin();
		iter != mEasyActiveList.end(); ++iter)
	{
		Easy* easy = *iter;
		check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
		delete easy;
	}
	mEasyActiveList.clear();
	mEasyActiveMap.clear();
	
	// Clean up freed
	for_each(mEasyFreeList.begin(), mEasyFreeList.end(), DeletePointer());	
	mEasyFreeList.clear();

	check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle));
	--gCurlMultiCount;

	if (LLCurl::sMultiThreaded)
	{
		LLCurl::Easy::sMultiMutex->unlock();
	}
}
Пример #11
0
void LLDrawable::deleteFaces(S32 offset, S32 count)
{
	face_list_t::iterator face_begin = mFaces.begin() + offset;
	face_list_t::iterator face_end = face_begin + count;

	std::for_each(face_begin, face_end, DeletePointer());
	mFaces.erase(face_begin, face_end);
}
Пример #12
0
void LLCurl::cleanupClass()
{
#if SAFE_SSL
    CRYPTO_set_locking_callback(NULL);
    for_each(sSSLMutex.begin(), sSSLMutex.end(), DeletePointer());
#endif
    curl_global_cleanup();
}
// Destroys the object
LLFloaterPay::~LLFloaterPay()
{
	std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer());
	// Name callbacks will be automatically disconnected since LLFloater is trackable
	
	// In case this floater is currently waiting for a reply.
	gMessageSystem->setHandlerFuncFast(_PREHASH_PayPriceReply, 0, 0);
}
Пример #14
0
LLToastNotifyPanel::~LLToastNotifyPanel()
{
    mButtonClickConnection.disconnect();

    std::for_each(mBtnCallbackData.begin(), mBtnCallbackData.end(), DeletePointer());
    mBtnCallbackData.clear();
    if (mIsTip)
    {
        LLNotifications::getInstance()->cancel(mNotification);
    }
}
Пример #15
0
// virtual
LLNotifyBox::~LLNotifyBox()
{
	delete mBehavior;
	mBehavior = NULL;

	std::for_each(mBtnCallbackData.begin(), mBtnCallbackData.end(), DeletePointer());

	if (mUnique)
	{
		sOpenUniqueNotifyBoxes.erase(getName() + mMessage);
	}
}
Пример #16
0
LLToastNotifyPanel::~LLToastNotifyPanel() 
{
	mButtonClickConnection.disconnect();

	std::for_each(mBtnCallbackData.begin(), mBtnCallbackData.end(), DeletePointer());
	if (mCloseNotificationOnDestroy && LLNotificationsUtil::find(mNotification->getID()) != NULL)
	{
		// let reusable notification be deleted
		mNotification->setReusable(false);
		LLNotifications::getInstance()->cancel(mNotification);
	}
}
Пример #17
0
// Called from either the main thread or the worker thread
void LLTextureCache::readHeaderCache(apr_pool_t* poolp)
{
	LLMutexLock lock(&mHeaderMutex);
	mHeaderEntriesInfo.mVersion = 0.f;
	mHeaderEntriesInfo.mEntries = 0;
	if (ll_apr_file_exists(mHeaderEntriesFileName, poolp))
	{
		ll_apr_file_read_ex(mHeaderEntriesFileName, poolp,
							(U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
	}
	if (mHeaderEntriesInfo.mVersion != sHeaderCacheVersion)
	{
		if (!mReadOnly)
		{
			// Info with 0 entries
			mHeaderEntriesInfo.mVersion = sHeaderCacheVersion;
			ll_apr_file_write_ex(mHeaderEntriesFileName, poolp,
								 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
		}
	}
	else
	{
		S32 num_entries = mHeaderEntriesInfo.mEntries;
		if (num_entries)
		{
			Entry* entries = new Entry[num_entries];
			ll_apr_file_read_ex(mHeaderEntriesFileName, poolp,
								(U8*)entries, sizeof(EntriesInfo), num_entries*sizeof(Entry));
			typedef std::set<lru_data*, lru_data::Compare> lru_set_t;
			lru_set_t lru;
			for (S32 i=0; i<num_entries; i++)
			{
				if (entries[i].mSize >= 0) // -1 indicates erased entry, skip
				{
					const LLUUID& id = entries[i].mID;
					lru.insert(new lru_data(entries[i].mTime, i, id));
					mHeaderIDMap[id] = i;
				}
			}
			mLRU.clear();
			S32 lru_entries = sCacheMaxEntries / 10;
			for (lru_set_t::iterator iter = lru.begin(); iter != lru.end(); ++iter)
			{
				lru_data* data = *iter;
				mLRU[data->index] = data->uuid;
				if (--lru_entries <= 0)
					break;
			}
			for_each(lru.begin(), lru.end(), DeletePointer());
			delete[] entries;
		}
	}
}
LLLayoutStack::~LLLayoutStack()
{
	// <FS:Zi> Save new sizes for this layout stack's panels
	if (mSaveSizes)
	{
		LLUI::sSettingGroups["account"]->setLLSD(mSizeControlName, mSavedSizes);
	}
	// </FS:Zi>

	e_panel_list_t panels = mPanels; // copy list of panel pointers
	mPanels.clear(); // clear so that removeChild() calls don't cause trouble
	std::for_each(panels.begin(), panels.end(), DeletePointer());
}
Пример #19
0
void LLScrollListItem::setNumColumns(S32 columns)
{
	S32 prev_columns = mColumns.size();
	if (columns < prev_columns)
	{
		std::for_each(mColumns.begin()+columns, mColumns.end(), DeletePointer());
	}
	
	mColumns.resize(columns);

	for (S32 col = prev_columns; col < columns; ++col)
	{
		mColumns[col] = NULL;
	}
}
Пример #20
0
void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd)
{
	LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT];
	if (self)
	{
		self->childSetText("details_edit", description);

		for_each(self->mMCDList.begin(), self->mMCDList.end(), DeletePointer());
		self->mMCDList.clear();
		if (mcd)
		{
			self->mMCDList.push_back(new LLMeanCollisionData(mcd));
		}
	}
}
Пример #21
0
void LLDrawable::cleanupReferences()
{
	LLFastTimer t(LLFastTimer::FTM_PIPELINE);
	
	std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
	mFaces.clear();

	gObjectList.removeDrawable(this);
	
	gPipeline.unlinkDrawable(this);
	
	// Cleanup references to other objects
	mVObjp = NULL;
	mParent = NULL;
}
Пример #22
0
FFSet::~FFSet()
{
	for
	(	TInclude::iterator itInclude = mInclude.begin()
	;	itInclude != mInclude.end()
	;	itInclude++
	){
		for
		(	TProject::iterator itProject = (*itInclude).begin()
		;	itProject != (*itInclude).end()
		;	itProject++
		){
			DeletePointer( (*itProject).second );
		}
	}
}
//-----------------------------------------------------------------------------
// deleteAllMotions()
//-----------------------------------------------------------------------------
void LLMotionController::deleteAllMotions()
{
	mLoadingMotions.clear();
	mLoadedMotions.clear();
	mActiveMotions.clear();
	//<singu>
	mActiveMask = 0;
	for_each(mDeprecatedMotions.begin(), mDeprecatedMotions.end(), DeletePointer());
	mDeprecatedMotions.clear();
	for (motion_map_t::iterator iter = mAllMotions.begin(); iter != mAllMotions.end(); ++iter)
	{
		iter->second->unregister_client();
	}
	//</singu>
	for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
	mAllMotions.clear();
}
// virtual
LLFloaterReporter::~LLFloaterReporter()
{
	// child views automatically deleted
	mObjectID 		= LLUUID::null;

	if (mPicking)
	{
		closePickTool(this);
	}

	mPosition.setVec(0.0f, 0.0f, 0.0f);

	std::for_each(mMCDList.begin(), mMCDList.end(), DeletePointer() );
	mMCDList.clear();

	delete mResourceDatap;
}
Пример #25
0
void LLCurl::Multi::cleanup(bool deleted)
{
	if(!mCurlMultiHandle)
	{
		return ; //nothing to clean.
	}
	llassert_always(deleted || !mValid) ;

	LLMutexLock lock(mDeletionMutexp);
	
	// Clean up active
	for(easy_active_list_t::iterator iter = mEasyActiveList.begin();
		iter != mEasyActiveList.end(); ++iter)
	{
		Easy* easy = *iter;
		check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));

		if(deleted)
		{
			easy->mResponder = NULL ; //avoid triggering mResponder.
		}
		delete easy;
	}
	mEasyActiveList.clear();
	mEasyActiveMap.clear();
	
	// Clean up freed
	for_each(mEasyFreeList.begin(), mEasyFreeList.end(), DeletePointer());	
	mEasyFreeList.clear();

	check_curl_multi_code(LLCurl::deleteMultiHandle(mCurlMultiHandle));
	mCurlMultiHandle = NULL ;
	
	delete mMutexp ;
	mMutexp = NULL ;
	delete mEasyMutexp ;
	mEasyMutexp = NULL ;

	mQueued = 0 ;
	mState = STATE_COMPLETED;
	
	--gCurlMultiCount;

	return ;
}
Пример #26
0
// virtual
LLFloaterReporter::~LLFloaterReporter()
{
	gReporterInstances.removeData(mReportType);
	// child views automatically deleted
	mObjectID 		= LLUUID::null;

	if (mPicking)
	{
		closePickTool(this);
	}

	mPosition.setVec(0.0f, 0.0f, 0.0f);

	std::for_each(mMCDList.begin(), mMCDList.end(), DeletePointer() );
	mMCDList.clear();

	delete mResourceDatap;
	gDialogVisible = FALSE;
}
Пример #27
0
void LLXferManager::updateHostStatus()
{
    LLXfer *xferp;
	LLHostStatus *host_statusp = NULL;

	for_each(mOutgoingHosts.begin(), mOutgoingHosts.end(), DeletePointer());
	mOutgoingHosts.clear();

	for (xferp = mSendList; xferp; xferp = xferp->mNext)
	{
		for (status_list_t::iterator iter = mOutgoingHosts.begin();
			 iter != mOutgoingHosts.end(); ++iter)
		{
			host_statusp = *iter;
			if (host_statusp->mHost == xferp->mRemoteHost)
			{
				break;
			}
		}
		if (!host_statusp)
		{
			host_statusp = new LLHostStatus();
			if (host_statusp)
			{
				host_statusp->mHost = xferp->mRemoteHost;
				mOutgoingHosts.push_front(host_statusp);
			}
		}
		if (host_statusp)
		{
			if (xferp->mStatus == e_LL_XFER_PENDING)
			{
				host_statusp->mNumPending++;
			}
			else if (xferp->mStatus == e_LL_XFER_IN_PROGRESS)
			{
				host_statusp->mNumActive++;
			}
		}
		
	}	
}
Пример #28
0
LLCurl::Multi::~Multi()
{
    // Clean up active
    for(easy_active_list_t::iterator iter = mEasyActiveList.begin();
            iter != mEasyActiveList.end(); ++iter)
    {
        Easy* easy = *iter;
        curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle());
        delete easy;
    }
    mEasyActiveList.clear();
    mEasyActiveMap.clear();

    // Clean up freed
    for_each(mEasyFreeList.begin(), mEasyFreeList.end(), DeletePointer());
    mEasyFreeList.clear();

    curl_multi_cleanup(mCurlMultiHandle);
    --gCurlMultiCount;
}
Пример #29
0
void LLDrawable::cleanupReferences()
{
	LLFastTimer t(FTM_CLEANUP_DRAWABLE);
	
	{
		LLFastTimer t(FTM_DELETE_FACES);
		std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
		mFaces.clear();
	}

	gObjectList.removeDrawable(this);
	
	gPipeline.unlinkDrawable(this);
	
	{
		LLFastTimer t(FTM_DEREF_DRAWABLE);
		// Cleanup references to other objects
		mVObjp = NULL;
		mParent = NULL;
	}
}
Пример #30
0
void LLTabContainer::deleteAllTabs()
{
	// Remove all the tab buttons and delete them.  Also, unlink all the child panels.
	for(std::vector<LLTabTuple*>::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
	{
		LLTabTuple* tuple = *iter;

		removeChild( tuple->mButton );
		delete tuple->mButton;

 		removeChild( tuple->mTabPanel );
// 		delete tuple->mTabPanel;
	}

	// Actually delete the tuples themselves
	std::for_each(mTabList.begin(), mTabList.end(), DeletePointer());
	mTabList.clear();
	
	// And there isn't a current tab any more
	mCurrentTabIdx = -1;
}