diff options
author | Rider Linden <rider@lindenlab.com> | 2018-08-24 16:46:07 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-08-24 16:46:07 -0700 |
commit | 06a77dd5fe228a3bbf4c57ae3b0c51937871d6a2 (patch) | |
tree | 4df4e1301ff1ed28bce8e9e63e37a2f85f61ebee /indra/newview/llpanelenvironment.cpp | |
parent | 185915aeede50dec00822c336537a335404252ed (diff) |
is dirty code in day cycle editor. When environment panel closes disconnect commit hook for crash.
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index d91f9110e0..51b2fa380f 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -119,7 +119,19 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) if (new_visibility) gIdleCallbacks.addFunction(onIdlePlay, this); else + { gIdleCallbacks.deleteFunction(onIdlePlay, this); + LLFloaterEditExtDayCycle *dayeditor = getEditFloater(); + if (mCommitConnection.connected()) + mCommitConnection.disconnect(); + if (dayeditor) + { + if (dayeditor->isDirty()) + dayeditor->refresh(); + else + dayeditor->closeFloater(); + } + } } @@ -213,13 +225,13 @@ LLFloaterSettingsPicker *LLPanelEnvironmentInfo::getSettingsPicker() return picker; } -LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater() +LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater(bool create) { static const S32 FOURHOURS(4 * 60 * 60); LLFloaterEditExtDayCycle *editor = static_cast<LLFloaterEditExtDayCycle *>(mEditFloater.get()); // Show the dialog - if (!editor) + if (!editor && create) { LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT, (mCurrentParcelId == INVALID_PARCEL_ID) ? LLFloaterEditExtDayCycle::CONTEXT_REGION : LLFloaterEditExtDayCycle::CONTEXT_PARCEL) (LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mCurrentEnvironment ? (S32)(mCurrentEnvironment->mDayLength.value()) : FOURHOURS)); @@ -228,9 +240,11 @@ LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater() if (!editor) return nullptr; - editor->setEditCommitSignal([this](LLSettingsDay::ptr_t pday) { onEditCommited(pday); }); } + if (editor && !mCommitConnection.connected()) + mCommitConnection = editor->setEditCommitSignal([this](LLSettingsDay::ptr_t pday) { onEditCommited(pday); }); + return editor; } |