From fc70dd436f3f0115b713cc316df93caa28271d0d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 31 Aug 2013 22:56:37 +0200 Subject: [PATCH] Fix of issue 1055 Thanks to sappadillidallagio and warctor/Parker for reporting. --- indra/newview/lffloaterinvpanel.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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