EXT-3531 - Ctrl-p doesn't work reliably on login

moved gEditMenuHandler handling to LLEditMenuHandler destructor
master
Richard Linden 2010-04-01 15:48:56 -07:00
parent 39ef9e9dd6
commit dcc5e0a4fa
7 changed files with 10 additions and 28 deletions

View File

@ -37,3 +37,10 @@
/* static */
LLEditMenuHandler* LLEditMenuHandler::gEditMenuHandler = NULL;
LLEditMenuHandler::~LLEditMenuHandler()
{
if (gEditMenuHandler == this)
{
gEditMenuHandler = NULL;
}
}

View File

@ -38,7 +38,7 @@ class LLEditMenuHandler
{
public:
// this is needed even though this is just an interface class.
virtual ~LLEditMenuHandler() {};
virtual ~LLEditMenuHandler();
virtual void undo() {};
virtual BOOL canUndo() const { return FALSE; }

View File

@ -192,12 +192,8 @@ LLLineEditor::~LLLineEditor()
{
mCommitOnFocusLost = FALSE;
// calls onCommit() while LLLineEditor still valid
gFocusMgr.releaseFocusIfNeeded( this );
if( gEditMenuHandler == this )
{
gEditMenuHandler = NULL;
}
}

View File

@ -324,11 +324,6 @@ LLScrollListCtrl::~LLScrollListCtrl()
delete mSortCallback;
std::for_each(mItemList.begin(), mItemList.end(), DeletePointer());
if( gEditMenuHandler == this )
{
gEditMenuHandler = NULL;
}
}

View File

@ -304,13 +304,7 @@ void LLTextEditor::initFromParams( const LLTextEditor::Params& p)
LLTextEditor::~LLTextEditor()
{
gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() while LLTextEditor still valid
// Route menu back to the default
if( gEditMenuHandler == this )
{
gEditMenuHandler = NULL;
}
// Scrollbar is deleted by LLView
std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer());

View File

@ -276,11 +276,6 @@ LLFolderView::~LLFolderView( void )
mRenamer = NULL;
mStatusTextBox = NULL;
if( gEditMenuHandler == this )
{
gEditMenuHandler = NULL;
}
mAutoOpenItems.removeAllNodes();
gIdleCallbacks.deleteFunction(idle, this);

View File

@ -1473,11 +1473,6 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
//////////////////////////////////////////////////////////////////////////////////////////
LLViewerMediaImpl::~LLViewerMediaImpl()
{
if( gEditMenuHandler == this )
{
gEditMenuHandler = NULL;
}
destroyMediaSource();
LLViewerMediaTexture::removeMediaImplFromTexture(mTextureId) ;