diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.h | 1 |
2 files changed, 6 insertions, 4 deletions
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]; |