diff options
-rw-r--r-- | indra/newview/llface.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 2 |
4 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 297661effd..3ccb363321 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2218,9 +2218,11 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) if (rigInfo.needsUpdate()) { LLVOVolume* vo_volume = (LLVOVolume*)mVObjp.get(); - LLVOAvatar* avatar = mVObjp->getAvatar(); const LLMeshSkinInfo* skin = vo_volume->getSkinInfo(); - LLSkinningUtil::updateRiggingInfo(skin, avatar, face); + if (skin) + { + LLSkinningUtil::updateRiggingInfo(skin, avatar, face); + } } // calculate the world space bounding box of the face by combining the bounding boxes of all the joints diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 1e7da126b0..d61333c2cc 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -227,6 +227,8 @@ LLModelPreview::~LLModelPreview() } mBaseModel.clear(); mBaseScene.clear(); + + LLLoadedCallbackEntry::cleanUpCallbackList(&mCallbackTextureList); } void LLModelPreview::updateDimentionsAndOffsets() @@ -553,7 +555,7 @@ void LLModelPreview::rebuildUploadData() { // in case user provided a missing file later texture->setIsMissingAsset(false); - texture->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, this, NULL, false); + texture->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, this, &mCallbackTextureList, false); texture->forceToSaveRawImage(0, F32_MAX); texture->updateFetch(); if (mModelLoader) @@ -3130,8 +3132,6 @@ LLJoint* LLModelPreview::lookupJointByName(const std::string& str, void* opaque) U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque) { - (void)opaque; - if (material.mDiffuseMapFilename.size()) { material.mOpaqueData = new LLPointer< LLViewerFetchedTexture >; @@ -3145,7 +3145,8 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque) } // Todo: might cause a crash if preview gets closed before we get the callback. // Use a callback list or guard callback in some way - tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, opaque, NULL, false); + LLModelPreview* preview = (LLModelPreview*)opaque; + tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, opaque, &preview->mCallbackTextureList, false); tex->forceToSaveRawImage(0, F32_MAX); material.setDiffuseMap(tex->getID()); // record tex ID return 1; diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index c615070105..e236d7ced7 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -316,6 +316,7 @@ protected: LLMeshUploadThread::instance_list mUploadData; std::set<LLViewerFetchedTexture * > mTextureSet; + LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList; //map of vertex buffers to models (one vertex buffer in vector per face in model std::map<LLModel*, std::vector<LLPointer<LLVertexBuffer> > > mVertexBuffer[LLModel::NUM_LODS + 1]; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 03c586b270..4a15b8624a 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1557,8 +1557,8 @@ void LLViewerFetchedTexture::postCreateTexture() if (!needsToSaveRawImage()) { mNeedsAux = false; - destroyRawImage(); } + destroyRawImage(); // will save raw image if needed mNeedsCreateTexture = false; } |