diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 894b4129ee8790e1d3cf6a03076b20b70cec1d5b..f71bfa4837ab9d8325e2759fd6c9fe8af473d80b 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -275,6 +275,7 @@ LLFolderView::~LLFolderView( void )
 	mStatusTextBox = NULL;
 
 	if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
+	mPopupMenuHandle.markDead();
 
 	mAutoOpenItems.removeAllNodes();
 	clearSelection();
@@ -1534,7 +1535,7 @@ void LLFolderView::deleteAllChildren()
 {
 	closeRenamer();
 	if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
-	mPopupMenuHandle = LLHandle<LLView>();
+	mPopupMenuHandle.markDead();
 	mScrollContainer = NULL;
 	mRenameItem = NULL;
 	mRenamer = NULL;
diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp
index 303afcda15154d000fe36a35c92c2463902f9c6c..0f1ffbd4c1acdf42726027cfaa7e1dfd88fd95a8 100644
--- a/indra/llui/llmenubutton.cpp
+++ b/indra/llui/llmenubutton.cpp
@@ -83,7 +83,7 @@ void LLMenuButton::hideMenu()
 
 LLToggleableMenu* LLMenuButton::getMenu()
 {
-	return dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
+	return static_cast<LLToggleableMenu*>(mMenuHandle.get());
 }
 
 void LLMenuButton::setMenu(const std::string& menu_filename, EMenuPosition position /*MP_TOP_LEFT*/)