summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp4
-rw-r--r--indra/newview/llworld.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 7157214cbc..6678e244b9 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -451,11 +451,13 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeigh
void LLDrawPoolWLSky::renderHeavenlyBodies()
{
+ if (!gSky.mVOSkyp) return;
+
LLGLSPipelineBlendSkyBox gls_skybox(true, false);
LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
gGL.pushMatrix();
- gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+ gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_SUN];
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index c5aff41746..eba9715ab5 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -38,6 +38,7 @@
#include "llglheaders.h"
#include "llhttpnode.h"
#include "llregionhandle.h"
+#include "llsky.h"
#include "llsurface.h"
#include "lltrans.h"
#include "llviewercamera.h"
@@ -117,6 +118,7 @@ void LLWorld::resetClass()
{
mHoleWaterObjects.clear();
gObjectList.destroy();
+ gSky.cleanup(); // references an object
for(region_list_t::iterator region_it = mRegionList.begin(); region_it != mRegionList.end(); )
{
LLViewerRegion* region_to_delete = *region_it++;