MAINT-7752 FIXED Crash in LLPreviewNotecard::handleSaveChangesDialog

meow-7.2.2
Mnikolenko Productengine 2017-08-25 17:02:33 +03:00
parent cbd4c0196f
commit e46f66ff31
6 changed files with 29 additions and 11 deletions

View File

@ -62,7 +62,8 @@ LLPreview::LLPreview(const LLSD& key)
mUserResized(FALSE),
mCloseAfterSave(FALSE),
mAssetStatus(PREVIEW_ASSET_UNLOADED),
mDirty(TRUE)
mDirty(TRUE),
mSaveDialogShown(FALSE)
{
mAuxItem = new LLInventoryItem;
// don't necessarily steal focus on creation -- sometimes these guys pop up without user action

View File

@ -121,7 +121,8 @@ protected:
// for LLInventoryObserver
virtual void changed(U32 mask);
BOOL mDirty;
BOOL mSaveDialogShown;
protected:
LLUUID mItemUUID;

View File

@ -234,9 +234,13 @@ BOOL LLPreviewGesture::canClose()
}
else
{
// Bring up view-modal dialog: Save changes? Yes, No, Cancel
LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(),
boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) );
if(!mSaveDialogShown)
{
mSaveDialogShown = TRUE;
// Bring up view-modal dialog: Save changes? Yes, No, Cancel
LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(),
boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) );
}
return FALSE;
}
}
@ -264,6 +268,7 @@ void LLPreviewGesture::onVisibilityChanged ( const LLSD& new_visibility )
bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response)
{
mSaveDialogShown = FALSE;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch(option)
{

View File

@ -153,9 +153,12 @@ BOOL LLPreviewNotecard::canClose()
}
else
{
// Bring up view-modal dialog: Save changes? Yes, No, Cancel
LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2));
if(!mSaveDialogShown)
{
mSaveDialogShown = TRUE;
// Bring up view-modal dialog: Save changes? Yes, No, Cancel
LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2));
}
return FALSE;
}
}
@ -639,6 +642,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const LLSD& response)
{
mSaveDialogShown = FALSE;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch(option)
{

View File

@ -376,7 +376,8 @@ LLScriptEdCore::LLScriptEdCore(
mLive(live),
mContainer(container),
mHasScriptData(FALSE),
mScriptRemoved(FALSE)
mScriptRemoved(FALSE),
mSaveDialogShown(FALSE)
{
setFollowsAll();
setBorderVisible(FALSE);
@ -855,8 +856,12 @@ BOOL LLScriptEdCore::canClose()
}
else
{
// Bring up view-modal dialog: Save changes? Yes, No, Cancel
LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2));
if(!mSaveDialogShown)
{
mSaveDialogShown = TRUE;
// Bring up view-modal dialog: Save changes? Yes, No, Cancel
LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2));
}
return FALSE;
}
}
@ -869,6 +874,7 @@ void LLScriptEdCore::setEnableEditing(bool enable)
bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response )
{
mSaveDialogShown = FALSE;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch( option )
{

View File

@ -167,6 +167,7 @@ private:
LLLiveLSLFile* mLiveFile;
LLUUID mAssociatedExperience;
BOOL mScriptRemoved;
BOOL mSaveDialogShown;
LLScriptEdContainer* mContainer; // parent view