Skip to content

Commit fe55c78

Browse files
authored
Merge pull request #4135 from secondlife/geenz/mac-outfit-gallery-crash-fix
Fix null outfit gallery observer pointer
2 parents 5b12428 + b62e7f9 commit fe55c78

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

indra/newview/lloutfitgallery.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ const S32 GALLERY_ITEMS_PER_ROW_MIN = 2;
6969

7070
LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p)
7171
: LLOutfitListBase(),
72-
mOutfitsObserver(NULL),
7372
mScrollPanel(NULL),
7473
mGalleryPanel(NULL),
7574
mLastRowPanel(NULL),
@@ -730,12 +729,6 @@ LLOutfitGallery::~LLOutfitGallery()
730729
{
731730
delete mOutfitGalleryMenu;
732731

733-
if (gInventory.containsObserver(mOutfitsObserver))
734-
{
735-
gInventory.removeObserver(mOutfitsObserver);
736-
}
737-
delete mOutfitsObserver;
738-
739732
while (!mUnusedRowPanels.empty())
740733
{
741734
LLPanel* panelp = mUnusedRowPanels.back();
@@ -797,7 +790,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id)
797790
{
798791
// Assume a subfolder that contains or will contain outfits, track it
799792
const LLUUID outfits = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
800-
mOutfitsObserver->addCategory(cat_id, [this, outfits]()
793+
mCategoriesObserver->addCategory(cat_id, [this, outfits]()
801794
{
802795
observerCallback(outfits);
803796
});
@@ -820,14 +813,8 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id)
820813
if (!outfit_category)
821814
return;
822815

823-
if (mOutfitsObserver == NULL)
824-
{
825-
mOutfitsObserver = new LLInventoryCategoriesObserver();
826-
gInventory.addObserver(mOutfitsObserver);
827-
}
828-
829816
// Start observing changes in "My Outfits" category.
830-
mOutfitsObserver->addCategory(cat_id,
817+
mCategoriesObserver->addCategory(cat_id,
831818
boost::bind(&LLOutfitGallery::refreshOutfit, this, cat_id), true);
832819

833820
outfit_category->fetch();
@@ -840,7 +827,7 @@ void LLOutfitGallery::updateRemovedCategory(LLUUID cat_id)
840827
if (outfits_iter != mOutfitMap.end())
841828
{
842829
// 0. Remove category from observer.
843-
mOutfitsObserver->removeCategory(cat_id);
830+
mCategoriesObserver->removeCategory(cat_id);
844831

845832
//const LLUUID& outfit_id = outfits_iter->first;
846833
LLOutfitGalleryItem* item = outfits_iter->second;

indra/newview/lloutfitgallery.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ class LLOutfitGallery : public LLOutfitListBase
184184
typedef item_num_map_t::value_type item_numb_map_value_t;
185185
item_num_map_t mItemIndexMap;
186186
std::map<S32, LLOutfitGalleryItem*> mIndexToItemMap;
187-
188-
189-
LLInventoryCategoriesObserver* mOutfitsObserver;
190187
};
191188
class LLOutfitGalleryContextMenu : public LLOutfitContextMenu
192189
{

0 commit comments

Comments
 (0)