diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index e0b64403eff83099168a429174f36443ad7d82dc..22269a92085855c35eff1f6dcb15d4ea05cda4f9 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -49,6 +49,8 @@ /// LLViewerAssetRequest ///---------------------------------------------------------------------------- +static const std::string VIEWER_ASSET_STROTRAGE_CORO_POOL = "VAssetStorage"; + /** * @brief Local class to encapsulate asset fetch requests with a timestamp. * @@ -127,6 +129,15 @@ LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager * { } +LLViewerAssetStorage::~LLViewerAssetStorage() +{ + if (!LLCoprocedureManager::wasDeleted()) + { + // This class has dedicated coroutine pool, clean it up, otherwise coroutines will crash later. + LLCoprocedureManager::instance().close(VIEWER_ASSET_STROTRAGE_CORO_POOL); + } +} + // virtual void LLViewerAssetStorage::storeAssetData( const LLTransactionID& tid, @@ -399,7 +410,7 @@ void LLViewerAssetStorage::queueRequestHttp( bool is_temp = false; LLViewerAssetStatsFF::record_enqueue(atype, with_http, is_temp); - LLCoprocedureManager::instance().enqueueCoprocedure("AssetStorage","LLViewerAssetStorage::assetRequestCoro", + LLCoprocedureManager::instance().enqueueCoprocedure(VIEWER_ASSET_STROTRAGE_CORO_POOL,"LLViewerAssetStorage::assetRequestCoro", boost::bind(&LLViewerAssetStorage::assetRequestCoro, this, req, uuid, atype, callback, user_data)); } } diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h index cefe2154315d96ac4a92f8d2e2048cb73cf9bb63..ef01d179b7bac20179ba983c0e3823d10fdf82fe 100644 --- a/indra/newview/llviewerassetstorage.h +++ b/indra/newview/llviewerassetstorage.h @@ -43,6 +43,8 @@ class LLViewerAssetStorage : public LLAssetStorage LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs); + ~LLViewerAssetStorage(); + virtual void storeAssetData( const LLTransactionID& tid, LLAssetType::EType atype,