diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index ecd67ff8afe770f5ee36fdc9677730d231058113..4ab09e7118dc83f492a49f266c49e05a24ed4861 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -170,7 +170,7 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility)
         }
 
         gIdleCallbacks.deleteFunction(onIdlePlay, this);
-        LLFloaterEditExtDayCycle *dayeditor = getEditFloater();
+        LLFloaterEditExtDayCycle *dayeditor = getEditFloater(false);
         if (mCommitConnection.connected())
             mCommitConnection.disconnect();
 
@@ -179,7 +179,10 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility)
             if (dayeditor->isDirty())
                 dayeditor->refresh();
             else
+            {
                 dayeditor->closeFloater();
+                mEditFloater.markDead();
+            }
         }
     }