diff --git a/indra/newview/lffloaterinvpanel.cpp b/indra/newview/lffloaterinvpanel.cpp index 0132579d2..522762080 100644 --- a/indra/newview/lffloaterinvpanel.cpp +++ b/indra/newview/lffloaterinvpanel.cpp @@ -57,8 +57,17 @@ void LFFloaterInvPanel::show(const LLUUID& cat_id, LLInventoryModel* model, cons // static void LFFloaterInvPanel::closeAll() { - for (instance_iter i = endInstances(); i >= beginInstances(); --i) - i->close(); + // We must make a copy first, because LLInstanceTracker doesn't allow destruction while having iterators to it. + std::vector cache; + for (instance_iter i = beginInstances(); i != endInstances(); ++i) + { + cache.push_back(&*i); + } + // Now close all panels, without using instance_iter iterators. + for (std::vector::iterator i = cache.begin(); i != cache.end(); ++i) + { + (*i)->close(); + } } // virtual