diff options
Diffstat (limited to 'indra/newview')
26 files changed, 267 insertions, 108 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f98ec69732..f52e6625c1 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2019,6 +2019,9 @@ bool LLAppViewer::cleanup()  	// Non-LLCurl libcurl library  	mAppCoreHttp.cleanup(); +	// NOTE The following call is not thread safe.  +	ll_cleanup_ares(); +  	LLFilePickerThread::cleanupClass();  	//MUST happen AFTER LLCurl::cleanupClass @@ -2114,6 +2117,8 @@ bool LLAppViewer::cleanup()  	ll_close_fail_log(); +	LLError::LLCallStacks::cleanup(); +  	removeMarkerFiles();      LL_INFOS() << "Goodbye!" << LL_ENDL; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 06f081e920..57fb84bbf1 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -438,7 +438,7 @@ void LLAppViewerWin32::disableWinErrorReporting()  const S32 MAX_CONSOLE_LINES = 500; -void create_console() +static bool create_console()  {  	int h_con_handle;  	long l_std_handle; @@ -447,7 +447,7 @@ void create_console()  	FILE *fp;  	// allocate a console for this app -	AllocConsole(); +	const bool isConsoleAllocated = AllocConsole();  	// set the screen buffer to be big enough to let us scroll text  	GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); @@ -495,10 +495,13 @@ void create_console()  		*stderr = *fp;  		setvbuf( stderr, NULL, _IONBF, 0 );  	} + +    return isConsoleAllocated;  }  LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) : -    mCmdLine(cmd_line) +	mCmdLine(cmd_line), +	mIsConsoleAllocated(false)  {  } @@ -542,6 +545,16 @@ bool LLAppViewerWin32::cleanup()  	gDXHardware.cleanup(); +#ifndef LL_RELEASE_FOR_DOWNLOAD +	LLWinDebug::instance().cleanup(); +#endif + +	if (mIsConsoleAllocated) +	{ +		FreeConsole(); +		mIsConsoleAllocated = false; +	} +  	return result;  } @@ -553,7 +566,7 @@ void LLAppViewerWin32::initLoggingAndGetLastDuration()  void LLAppViewerWin32::initConsole()  {  	// pop up debug console -	create_console(); +	mIsConsoleAllocated = create_console();  	return LLAppViewer::initConsole();  } diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index fb37df1a2f..59d1ddaa3d 100644 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -61,7 +61,8 @@ protected:  private:  	void disableWinErrorReporting(); -    std::string mCmdLine; +	std::string mCmdLine; +	bool mIsConsoleAllocated;  };  #endif // LL_LLAPPVIEWERWIN32_H diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 05c4181714..84b9ac756a 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -107,6 +107,7 @@ class LLChatHistoryHeader: public LLPanel  public:  	LLChatHistoryHeader()  	:	LLPanel(), +		mInfoCtrl(NULL),  		mPopupMenuHandleAvatar(),  		mPopupMenuHandleObject(),  		mAvatarID(), @@ -129,9 +130,6 @@ public:  	~LLChatHistoryHeader()  	{ -		// Detach the info button so that it doesn't get destroyed (EXT-8463). -		hideInfoCtrl(); -  		if (mAvatarNameCacheConnection.connected())  		{  			mAvatarNameCacheConnection.disconnect(); @@ -292,6 +290,11 @@ public:  		mUserNameTextBox = getChild<LLTextBox>("user_name");  		mTimeBoxTextBox = getChild<LLTextBox>("time_box"); +		mInfoCtrl = LLUICtrlFactory::getInstance()->createFromFile<LLUICtrl>("inspector_info_ctrl.xml", this, LLPanel::child_registry_t::instance()); +		llassert(mInfoCtrl != NULL); +		mInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, mInfoCtrl)); +		mInfoCtrl->setVisible(FALSE); +  		return LLPanel::postBuild();  	} @@ -589,39 +592,19 @@ protected:  	void showInfoCtrl()  	{ -		if (mAvatarID.isNull() || mFrom.empty() || CHAT_SOURCE_SYSTEM == mSourceType) return; -				 -		if (!sInfoCtrl) -		{ -			// *TODO: Delete the button at exit. -			sInfoCtrl = LLUICtrlFactory::createFromFile<LLUICtrl>("inspector_info_ctrl.xml", NULL, LLPanel::child_registry_t::instance()); -			if (sInfoCtrl) -			{ -				sInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, sInfoCtrl)); -			} -		} - -		if (!sInfoCtrl) +		const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType; +		if (isVisible)  		{ -			llassert(sInfoCtrl != NULL); -			return; +			const LLRect sticky_rect = mUserNameTextBox->getRect(); +			S32 icon_x = llmin(sticky_rect.mLeft + mUserNameTextBox->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); +			mInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - mInfoCtrl->getRect().getHeight() / 2 ) ;  		} - -		LLTextBox* name = getChild<LLTextBox>("user_name"); -		LLRect sticky_rect = name->getRect(); -		S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); -		sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ; -		addChild(sInfoCtrl); +		mInfoCtrl->setVisible(isVisible);  	}  	void hideInfoCtrl()  	{ -		if (!sInfoCtrl) return; - -		if (sInfoCtrl->getParent() == this) -		{ -			removeChild(sInfoCtrl); -		} +		mInfoCtrl->setVisible(FALSE);  	}  private: @@ -692,7 +675,7 @@ protected:  	LLHandle<LLView>	mPopupMenuHandleAvatar;  	LLHandle<LLView>	mPopupMenuHandleObject; -	static LLUICtrl*	sInfoCtrl; +	LLUICtrl*			mInfoCtrl;  	LLUUID			    mAvatarID;  	LLSD				mObjectData; @@ -709,8 +692,6 @@ private:  	boost::signals2::connection mAvatarNameCacheConnection;  }; -LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; -  LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)  :	LLUICtrl(p),  	mMessageHeaderFilename(p.message_header), diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index bb6d4fb59c..44736a0489 100755 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -93,14 +93,15 @@ class LLChatHistory : public LLUICtrl  		 * @return pointer to LLView separator object.  		 */  		LLView* getSeparator(); + +		void onClickMoreText(); + +	private:  		/**  		 * Builds a message header.  		 * @return pointer to LLView header object.  		 */  		LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args); - -		void onClickMoreText(); -  	public:  		~LLChatHistory();  		LLSD getValue() const;    diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index fd4f17b694..cfc62c07b6 100755 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -29,7 +29,6 @@  #include "llchatitemscontainerctrl.h"  #include "lltextbox.h" -#include "llchatmsgbox.h"  #include "llavatariconctrl.h"  #include "llcommandhandler.h"  #include "llfloaterreg.h" @@ -130,7 +129,6 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)  {  	std::string		messageText = notification["message"].asString();		// UTF-8 line of text -	LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false);  	std::string color_name = notification["text_color"].asString(); @@ -171,7 +169,7 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)  		{  			style_params.font.style = "ITALIC";  		} -		msg_text->appendText(messageText, TRUE, style_params); +		mMsgText->appendText(messageText, TRUE, style_params);  	}  	snapToMessageHeight(); @@ -204,9 +202,10 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)  		case 2:	messageFont = LLFontGL::getFontSansSerifBig();	break;  	} -	LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); +	mMsgText = getChild<LLChatMsgBox>("msg_text", false); +	mMsgText->setContentTrusted(false); -	msg_text->setText(std::string("")); +	mMsgText->setText(std::string(""));  	if ( notification["chat_style"].asInteger() != CHAT_STYLE_IRC )  	{ @@ -232,12 +231,12 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)  			style_params_name.link_href = notification["sender_slurl"].asString();  			style_params_name.is_link = true; -			msg_text->appendText(str_sender, FALSE, style_params_name); +			mMsgText->appendText(str_sender, FALSE, style_params_name);  		}  		else  		{ -			msg_text->appendText(str_sender, false); +			mMsgText->appendText(str_sender, false);  		}  	} @@ -264,7 +263,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)  		{  			style_params.font.style = "ITALIC";  		} -		msg_text->appendText(messageText, FALSE, style_params); +		mMsgText->appendText(messageText, FALSE, style_params);  	} @@ -275,8 +274,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)  void	LLFloaterIMNearbyChatToastPanel::snapToMessageHeight	()  { -	LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false); -	S32 new_height = llmax (text_box->getTextPixelHeight() + 2*text_box->getVPad() + 2*msg_height_pad, 25); +	S32 new_height = llmax (mMsgText->getTextPixelHeight() + 2*mMsgText->getVPad() + 2*msg_height_pad, 25);  	LLRect panel_rect = getRect(); @@ -312,14 +310,13 @@ BOOL	LLFloaterIMNearbyChatToastPanel::handleMouseUp	(S32 x, S32 y, MASK mask)  		return LLPanel::handleMouseUp(x,y,mask);      */ -	LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false); -	S32 local_x = x - text_box->getRect().mLeft; -	S32 local_y = y - text_box->getRect().mBottom; +	S32 local_x = x - mMsgText->getRect().mLeft; +	S32 local_y = y - mMsgText->getRect().mBottom;  	//if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat. -	if (text_box->pointInView(local_x, local_y) ) +	if (mMsgText->pointInView(local_x, local_y) )  	{ -		if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE) +		if (mMsgText->handleMouseUp(local_x,local_y,mask) == TRUE)  			return TRUE;  		else  		{ diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index 54b6499d52..f66670ec8c 100755 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -28,6 +28,7 @@  #define LL_LLCHATITEMSCONTAINERCTRL_H_  #include "llchat.h" +#include "llchatmsgbox.h"  #include "llpanel.h"  #include "llscrollbar.h"  #include "llviewerchat.h" @@ -85,6 +86,7 @@ private:  	LLUUID			mFromID;	// agent id or object id  	std::string		mFromName;  	EChatSourceType	mSourceType; +	LLChatMsgBox* 	mMsgText; diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b1dce42dfd..c0823182c0 100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -204,6 +204,7 @@ void LLNotificationChiclet::createMenu()  	enable_registrar.add("NotificationWellChicletMenu.EnableItem",  		boost::bind(&LLNotificationChiclet::enableMenuItem, this, _2)); +	llassert(LLMenuGL::sMenuContainer != NULL);  	mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>  		("menu_notification_well_button.xml",  		 LLMenuGL::sMenuContainer, diff --git a/indra/newview/lllistcontextmenu.cpp b/indra/newview/lllistcontextmenu.cpp index a624c9fb87..6bda8b1d0d 100755 --- a/indra/newview/lllistcontextmenu.cpp +++ b/indra/newview/lllistcontextmenu.cpp @@ -110,6 +110,7 @@ void LLListContextMenu::handleMultiple(functor_t functor, const uuid_vec_t& ids)  // static  LLContextMenu* LLListContextMenu::createFromFile(const std::string& filename)  { +	llassert(LLMenuGL::sMenuContainer != NULL);  	return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(  		filename, LLContextMenu::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());  } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index f406bb9f06..0178512cb5 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -391,8 +391,12 @@ BOOL LLMediaCtrl::postBuild ()  	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;  	registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this)); +	// stinson 05/05/2014 : use this as the parent of the context menu if the static menu +	// container has yet to be created +	LLPanel* menuParent = (LLMenuGL::sMenuContainer != NULL) ? dynamic_cast<LLPanel*>(LLMenuGL::sMenuContainer) : dynamic_cast<LLPanel*>(this); +	llassert(menuParent != NULL);  	mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( -		"menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); +		"menu_media_ctrl.xml", menuParent, LLViewerMenuHolderGL::child_registry_t::instance());  	setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChanged, this, _2));  	return TRUE; @@ -1118,3 +1122,8 @@ void LLMediaCtrl::setTrustedContent(bool trusted)  		mMediaSource->setTrustedBrowser(trusted);  	}  } + +void LLMediaCtrl::updateContextMenuParent(LLView* pNewParent) +{ +	mContextMenu->updateParent(pNewParent); +} diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 5978a7a344..b07eb356ae 100755 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -168,6 +168,8 @@ public:  		LLUUID getTextureID() {return mMediaTextureID;} +		void updateContextMenuParent(LLView* pNewParent); +  	protected:  		void convertInputCoords(S32& x, S32& y); diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 2f65bedc2b..f7c2f629ec 100755 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -129,11 +129,11 @@ void LLInboxFolderViewFolder::addItem(LLFolderViewItem* item)  // virtual  void LLInboxFolderViewFolder::draw()  { -	if (!badgeHasParent()) +	if (!hasBadgeHolderParent())  	{ -		addBadgeToParentPanel(); +		addBadgeToParentHolder();  	} -	 +  	setBadgeVisibility(mFresh);  	LLFolderViewFolder::draw(); @@ -214,9 +214,9 @@ BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)  // virtual  void LLInboxFolderViewItem::draw()  { -	if (!badgeHasParent()) +	if (!hasBadgeHolderParent())  	{ -		addBadgeToParentPanel(); +		addBadgeToParentHolder();  	}  	setBadgeVisibility(mFresh); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 8ccbb03fcc..496168229d 100755 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -159,6 +159,7 @@ public:  		registrar.add("Wearable.Create", boost::bind(onCreate, _2)); +		llassert(LLMenuGL::sMenuContainer != NULL);  		LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(  			"menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());  		llassert(menu); @@ -228,6 +229,7 @@ public:  		enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2));  		enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); +		llassert(LLMenuGL::sMenuContainer != NULL);  		LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(  			"menu_add_wearable_gear.xml",  			LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 8fddd9523f..652d2be6f6 100755 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -341,6 +341,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu()  	registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this));  	// create the context menu from the XUI +	llassert(LLMenuGL::sMenuContainer != NULL);  	return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(  		"menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());  } @@ -935,6 +936,7 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y  	registrar.add("TeleportHistory.TabClose",	boost::bind(&LLTeleportHistoryPanel::onAccordionTabClose, this, tab));  	// create the context menu from the XUI +	llassert(LLMenuGL::sMenuContainer != NULL);  	mAccordionTabMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(  		"menu_teleport_history_tab.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 6a840f3f40..8708fb87ee 100755 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -273,6 +273,14 @@ void LLScreenChannel::addToast(const LLToast::Params& p)  			// only cancel notification if it isn't being used in IM session  			LLNotifications::instance().cancel(notification);  		} + +		// It was assumed that the toast would take ownership of the panel pointer. +		// But since we have decided not to display the toast, kill the panel to +		// prevent the memory leak. +		if (p.panel != NULL) +		{ +			p.panel()->die(); +		}  		return;  	} diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index a7b99a0f6b..08a4d00d0f 100755 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -640,12 +640,26 @@ class LLVolumeGeometryManager: public LLGeometryManager  		DISTANCE_SORT  	} eSortType; -	virtual ~LLVolumeGeometryManager() { } +	LLVolumeGeometryManager(); +	virtual ~LLVolumeGeometryManager();  	virtual void rebuildGeom(LLSpatialGroup* group);  	virtual void rebuildMesh(LLSpatialGroup* group);  	virtual void getGeometry(LLSpatialGroup* group);  	void genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE);  	void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); + +private: +	void allocateFaces(U32 pMaxFaceCount); +	void freeFaces(); + +	static int32_t sInstanceCount; +	static LLFace** sFullbrightFaces; +	static LLFace** sBumpFaces; +	static LLFace** sSimpleFaces; +	static LLFace** sNormFaces; +	static LLFace** sSpecFaces; +	static LLFace** sNormSpecFaces; +	static LLFace** sAlphaFaces;  };  //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index a27105e22d..39adfb3431 100755 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -54,6 +54,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) :	LLToastPanel(p.notif  	mAvatarName = getChild<LLTextBox>("user_name");  	mTime = getChild<LLTextBox>("time_box");  	mMessage = getChild<LLTextBox>("message"); +	mMessage->setContentTrusted(false);  	LLStyle::Params style_params;  	LLFontGL* fontp = LLViewerChat::getChatFont(); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 51935dc03b..907baf0661 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -270,8 +270,12 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )      // customize panel's attributes      // is it intended for displaying a tip?      mIsTip = mNotification->getType() == "notifytip"; + +    std::string notif_name = mNotification->getName();      // is it a script dialog? -    mIsScriptDialog = (mNotification->getName() == "ScriptDialog" || mNotification->getName() == "ScriptDialogGroup"); +    mIsScriptDialog = (notif_name == "ScriptDialog" || notif_name == "ScriptDialogGroup"); + +    bool is_content_trusted = (notif_name != "LoadWebPage");      // is it a caution?      //      // caution flag can be set explicitly by specifying it in the notification payload, or it can be set implicitly if the @@ -314,6 +318,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )      mTextBox->setMaxTextLength(MAX_LENGTH);      mTextBox->setVisible(TRUE);      mTextBox->setPlainText(!show_images); +    mTextBox->setContentTrusted(is_content_trusted);      mTextBox->setValue(mNotification->getMessage());  	mTextBox->setIsFriendCallback(LLAvatarActions::isFriend); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 7aa0af5d93..ed26842035 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1593,6 +1593,17 @@ void LLViewerMedia::cleanupClass()  {  	gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL);  	sTeleportFinishConnection.disconnect(); +	if (sSpareBrowserMediaSource != NULL) +	{ +		delete sSpareBrowserMediaSource; +		sSpareBrowserMediaSource = NULL; +	} + +	if (sCookieStore != NULL) +	{ +		delete sCookieStore; +		sCookieStore = NULL; +	}  }  ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 9d2a4a50e1..dafe2cafec 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -355,6 +355,16 @@ LLViewerShaderMgr * LLViewerShaderMgr::instance()  	return static_cast<LLViewerShaderMgr*>(sInstance);  } +// static +void LLViewerShaderMgr::releaseInstance() +{ +	if (sInstance != NULL) +	{ +		delete sInstance; +		sInstance = NULL; +	} +} +  void LLViewerShaderMgr::initAttribsAndUniforms(void)  {  	if (mReservedAttribs.empty()) diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 42147fdd29..923aa522ad 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -43,6 +43,7 @@ public:  	// singleton pattern implementation  	static LLViewerShaderMgr * instance(); +	static void releaseInstance();  	void initAttribsAndUniforms(void);  	void setShaders(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b2b5c9d903..d052906bee 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -261,7 +261,7 @@ std::string	LLViewerWindow::sMovieBaseName;  LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); -class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole> +class RecordToChatConsoleRecorder : public LLError::Recorder  {  public:  	virtual void recordMessage(LLError::ELevel level, @@ -285,6 +285,22 @@ public:  	}  }; +class RecordToChatConsole : public LLSingleton<RecordToChatConsole> +{ +public: +	RecordToChatConsole() +		: LLSingleton<RecordToChatConsole>(), +		mRecorder(new RecordToChatConsoleRecorder()) +	{ +	} + +	void startRecorder() { LLError::addRecorder(mRecorder); } +	void stopRecorder() { LLError::removeRecorder(mRecorder); } + +private: +	LLError::RecorderPtr mRecorder; +}; +  ////////////////////////////////////////////////////////////////////////////  //  // LLDebugText @@ -1886,11 +1902,11 @@ void LLViewerWindow::initBase()  	// optionally forward warnings to chat console/chat floater  	// for qa runs and dev builds  #if  !LL_RELEASE_FOR_DOWNLOAD -	LLError::addRecorder(RecordToChatConsole::getInstance()); +	RecordToChatConsole::getInstance()->startRecorder();  #else  	if(gSavedSettings.getBOOL("QAMode"))  	{ -		LLError::addRecorder(RecordToChatConsole::getInstance()); +		RecordToChatConsole::getInstance()->startRecorder();  	}  #endif @@ -1907,9 +1923,7 @@ void LLViewerWindow::initBase()  	setProgressCancelButtonVisible(FALSE);  	gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder"); -  	LLMenuGL::sMenuContainer = gMenuHolder; -  }  void LLViewerWindow::initWorldUI() @@ -2039,8 +2053,7 @@ void LLViewerWindow::initWorldUI()  void LLViewerWindow::shutdownViews()  {  	// clean up warning logger -	LLError::removeRecorder(RecordToChatConsole::getInstance()); - +	RecordToChatConsole::getInstance()->stopRecorder();  	LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ;  	delete mDebugText; @@ -2075,6 +2088,9 @@ void LLViewerWindow::shutdownViews()  	// access to gMenuHolder  	cleanup_menus();  	LL_INFOS() << "menus destroyed." << LL_ENDL ; + +	view_listener_t::cleanup(); +	LL_INFOS() << "view listeners destroyed." << LL_ENDL ;  	// Delete all child views.  	delete mRootView; @@ -2150,6 +2166,12 @@ LLViewerWindow::~LLViewerWindow()  	delete mDebugText;  	mDebugText = NULL; + +	if (LLViewerShaderMgr::sInitialized) +	{ +		LLViewerShaderMgr::releaseInstance(); +		LLViewerShaderMgr::sInitialized = FALSE; +	}  } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 1f497bc107..42a7c2e576 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1917,7 +1917,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const  /*static*/  void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)  { -	gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); +	if (gAgentAvatarp.notNull()) +	{ +		gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); +	}  }  void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c9f03a3b7d..945d3711f0 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4059,7 +4059,8 @@ U32 LLVOVolume::getPartitionType() const  }  LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB, regionp) +: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB, regionp), +LLVolumeGeometryManager()  {  	mLODPeriod = 32;  	mDepthMask = FALSE; @@ -4070,7 +4071,8 @@ LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp)  }  LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep, LLViewerRegion* regionp) -: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK, regionp) +: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK, regionp), +LLVolumeGeometryManager()  {  	mDepthMask = FALSE;  	mLODPeriod = 32; @@ -4107,6 +4109,70 @@ bool can_batch_texture(LLFace* facep)  	return true;  } +const static U32 MAX_FACE_COUNT = 4096U; +int32_t LLVolumeGeometryManager::sInstanceCount = 0; +LLFace** LLVolumeGeometryManager::sFullbrightFaces = NULL; +LLFace** LLVolumeGeometryManager::sBumpFaces = NULL; +LLFace** LLVolumeGeometryManager::sSimpleFaces = NULL; +LLFace** LLVolumeGeometryManager::sNormFaces = NULL; +LLFace** LLVolumeGeometryManager::sSpecFaces = NULL; +LLFace** LLVolumeGeometryManager::sNormSpecFaces = NULL; +LLFace** LLVolumeGeometryManager::sAlphaFaces = NULL; + +LLVolumeGeometryManager::LLVolumeGeometryManager() +	: LLGeometryManager() +{ +	llassert(sInstanceCount >= 0); +	if (sInstanceCount == 0) +	{ +		allocateFaces(MAX_FACE_COUNT); +	} + +	++sInstanceCount; +} + +LLVolumeGeometryManager::~LLVolumeGeometryManager() +{ +	llassert(sInstanceCount > 0); +	--sInstanceCount; + +	if (sInstanceCount <= 0) +	{ +		freeFaces(); +		sInstanceCount = 0; +	} +} + +void LLVolumeGeometryManager::allocateFaces(U32 pMaxFaceCount) +{ +	sFullbrightFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +	sBumpFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +	sSimpleFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +	sNormFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +	sSpecFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +	sNormSpecFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +	sAlphaFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*))); +} + +void LLVolumeGeometryManager::freeFaces() +{ +	ll_aligned_free<64>(sFullbrightFaces); +	ll_aligned_free<64>(sBumpFaces); +	ll_aligned_free<64>(sSimpleFaces); +	ll_aligned_free<64>(sNormFaces); +	ll_aligned_free<64>(sSpecFaces); +	ll_aligned_free<64>(sNormSpecFaces); +	ll_aligned_free<64>(sAlphaFaces); + +	sFullbrightFaces = NULL; +	sBumpFaces = NULL; +	sSimpleFaces = NULL; +	sNormFaces = NULL; +	sSpecFaces = NULL; +	sNormSpecFaces = NULL; +	sAlphaFaces = NULL; +} +  static LLTrace::BlockTimerStatHandle FTM_REGISTER_FACE("Register Face");  void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type) @@ -4429,16 +4495,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  	mFaceList.clear(); -	const U32 MAX_FACE_COUNT = 4096; -	 -	static LLFace** fullbright_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	static LLFace** bump_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	static LLFace** simple_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	static LLFace** norm_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	static LLFace** spec_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	static LLFace** normspec_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	static LLFace** alpha_faces = (LLFace**) ll_aligned_malloc<64>(MAX_FACE_COUNT*sizeof(LLFace*)); -	  	U32 fullbright_count = 0;  	U32 bump_count = 0;  	U32 simple_count = 0; @@ -4816,7 +4872,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  						{ //can be treated as alpha mask  							if (simple_count < MAX_FACE_COUNT)  							{ -								simple_faces[simple_count++] = facep; +								sSimpleFaces[simple_count++] = facep;  							}  						}  						else @@ -4827,7 +4883,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  							}  							if (alpha_count < MAX_FACE_COUNT)  							{ -								alpha_faces[alpha_count++] = facep; +								sAlphaFaces[alpha_count++] = facep;  							}  						}  					} @@ -4850,14 +4906,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  									{ //has normal and specular maps (needs texcoord1, texcoord2, and tangent)  										if (normspec_count < MAX_FACE_COUNT)  										{ -											normspec_faces[normspec_count++] = facep; +											sNormSpecFaces[normspec_count++] = facep;  										}  									}  									else  									{ //has normal map (needs texcoord1 and tangent)  										if (norm_count < MAX_FACE_COUNT)  										{ -											norm_faces[norm_count++] = facep; +											sNormFaces[norm_count++] = facep;  										}  									}  								} @@ -4865,14 +4921,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  								{ //has specular map but no normal map, needs texcoord2  									if (spec_count < MAX_FACE_COUNT)  									{ -										spec_faces[spec_count++] = facep; +										sSpecFaces[spec_count++] = facep;  									}  								}  								else  								{ //has neither specular map nor normal map, only needs texcoord0  									if (simple_count < MAX_FACE_COUNT)  									{ -										simple_faces[simple_count++] = facep; +										sSimpleFaces[simple_count++] = facep;  									}  								}									  							} @@ -4880,14 +4936,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  							{ //needs normal + tangent  								if (bump_count < MAX_FACE_COUNT)  								{ -									bump_faces[bump_count++] = facep; +									sBumpFaces[bump_count++] = facep;  								}  							}  							else if (te->getShiny() || !te->getFullbright())  							{ //needs normal  								if (simple_count < MAX_FACE_COUNT)  								{ -									simple_faces[simple_count++] = facep; +									sSimpleFaces[simple_count++] = facep;  								}  							}  							else  @@ -4895,7 +4951,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  								facep->setState(LLFace::FULLBRIGHT);  								if (fullbright_count < MAX_FACE_COUNT)  								{ -									fullbright_faces[fullbright_count++] = facep; +									sFullbrightFaces[fullbright_count++] = facep;  								}  							}  						} @@ -4905,7 +4961,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  							{ //needs normal + tangent  								if (bump_count < MAX_FACE_COUNT)  								{ -									bump_faces[bump_count++] = facep; +									sBumpFaces[bump_count++] = facep;  								}  							}  							else if ((te->getShiny() && LLPipeline::sRenderBump) || @@ -4913,7 +4969,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  							{ //needs normal  								if (simple_count < MAX_FACE_COUNT)  								{ -									simple_faces[simple_count++] = facep; +									sSimpleFaces[simple_count++] = facep;  								}  							}  							else  @@ -4921,7 +4977,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  								facep->setState(LLFace::FULLBRIGHT);  								if (fullbright_count < MAX_FACE_COUNT)  								{ -									fullbright_faces[fullbright_count++] = facep; +									sFullbrightFaces[fullbright_count++] = facep;  								}  							}  						} @@ -4993,13 +5049,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  		fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX;  	} -	genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, simple_count, FALSE, batch_textures, FALSE); -	genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, fullbright_count, FALSE, batch_textures); -	genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, alpha_count, TRUE, batch_textures); -	genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, FALSE); -	genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, norm_faces, norm_count, FALSE, FALSE); -	genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, spec_faces, spec_count, FALSE, FALSE); -	genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, normspec_faces, normspec_count, FALSE, FALSE); +	genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sSimpleFaces, simple_count, FALSE, batch_textures, FALSE); +	genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sFullbrightFaces, fullbright_count, FALSE, batch_textures); +	genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sAlphaFaces, alpha_count, TRUE, batch_textures); +	genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sBumpFaces, bump_count, FALSE, FALSE); +	genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sNormFaces, norm_count, FALSE, FALSE); +	genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sSpecFaces, spec_count, FALSE, FALSE); +	genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sNormSpecFaces, normspec_count, FALSE, FALSE);  	if (!LLPipeline::sDelayVBUpdate)  	{ diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 551d0be8d7..eff70ca0b2 100755 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -45,7 +45,7 @@ public:  	~LLMemoryReserve();  	void reserve();  	void release(); -protected: +private:  	unsigned char *mReserve;  	static const size_t MEMORY_RESERVATION_SIZE;  }; @@ -53,7 +53,7 @@ protected:  LLMemoryReserve::LLMemoryReserve() :  	mReserve(NULL)  { -}; +}  LLMemoryReserve::~LLMemoryReserve()  { @@ -66,14 +66,19 @@ const size_t LLMemoryReserve::MEMORY_RESERVATION_SIZE = 5 * 1024 * 1024;  void LLMemoryReserve::reserve()  {  	if(NULL == mReserve) +	{  		mReserve = new unsigned char[MEMORY_RESERVATION_SIZE]; -}; +	} +}  void LLMemoryReserve::release()  { -	delete [] mReserve; +	if (NULL != mReserve) +	{ +		delete [] mReserve; +	}  	mReserve = NULL; -}; +}  static LLMemoryReserve gEmergencyMemoryReserve; @@ -130,6 +135,11 @@ void  LLWinDebug::init()  	}  } +void LLWinDebug::cleanup () +{ +	gEmergencyMemoryReserve.release(); +} +  void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename)  {  	// Temporary fix to switch out the code that writes the DMP file. diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h index 6f274c6f16..a3cbf6dc03 100755 --- a/indra/newview/llwindebug.h +++ b/indra/newview/llwindebug.h @@ -37,6 +37,7 @@ class LLWinDebug:  public:  	static void init();  	static void generateMinidump(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL); +	static void cleanup();  private:  	static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename);  };  | 
