aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventoryview.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llinventoryview.h')
-rw-r--r--linden/indra/newview/llinventoryview.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h
index bdc24e0..1762165 100644
--- a/linden/indra/newview/llinventoryview.h
+++ b/linden/indra/newview/llinventoryview.h
@@ -225,6 +225,34 @@ public:
225 static void toggleVisibility(); 225 static void toggleVisibility();
226 static void toggleVisibility(void*) { toggleVisibility(); } 226 static void toggleVisibility(void*) { toggleVisibility(); }
227 227
228// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
229 static void closeAll()
230 {
231 // If there are mulitple inventory floaters open then clicking the "Inventory" button will close
232 // them one by one (see LLToolBar::onClickInventory() => toggleVisibility() ) until we get to the
233 // last one which will just be hidden instead of closed/destroyed (see LLInventoryView::onClose)
234 //
235 // However the view isn't removed from sActiveViews until its destructor is called and since
236 // 'LLMortician::sDestroyImmediate == FALSE' while the viewer is running the destructor won't be
237 // called right away
238 //
239 // Result: we can't call close() on the last (sActiveViews.count() will still be > 1) because
240 // onClose() would take the wrong branch and destroy() it as well
241 //
242 // Workaround: "fix" onClose() to count only views that aren't marked as "dead"
243
244 LLInventoryView* pView; U8 flagsSound;
245 for (S32 idx = sActiveViews.count() - 1; idx >= 0; idx--)
246 {
247 pView = sActiveViews.get(idx);
248 flagsSound = pView->getSoundFlags();
249 pView->setSoundFlags(LLView::SILENT); // Suppress the window close sound
250 pView->close(); // onClose() protects against closing the last inventory floater
251 pView->setSoundFlags(flagsSound); // One view won't be destroy()'ed so it needs its sound flags restored
252 }
253 }
254// [/RLVa:KB]
255
228 // Final cleanup, destroy all open inventory views. 256 // Final cleanup, destroy all open inventory views.
229 static void cleanup(); 257 static void cleanup();
230 258