Skip to content
Snippets Groups Projects
Commit 5d812b95 authored by Mnikolenko Productengine's avatar Mnikolenko Productengine
Browse files

MAINT-7581 [contribution] Closing the 'Replace links' floater crashes the...

MAINT-7581 [contribution] Closing the 'Replace links' floater crashes the viewer if a replace is in progress
parent dcb6a850
No related branches found
No related tags found
No related merge requests found
...@@ -823,6 +823,7 @@ Kitty Barnett ...@@ -823,6 +823,7 @@ Kitty Barnett
MAINT-6154 MAINT-6154
MAINT-6568 MAINT-6568
STORM-2149 STORM-2149
MAINT-7581
Kolor Fall Kolor Fall
Komiko Okamoto Komiko Okamoto
Korvel Noh Korvel Noh
......
...@@ -41,16 +41,13 @@ LLFloaterLinkReplace::LLFloaterLinkReplace(const LLSD& key) ...@@ -41,16 +41,13 @@ LLFloaterLinkReplace::LLFloaterLinkReplace(const LLSD& key)
mRemainingItems(0), mRemainingItems(0),
mSourceUUID(LLUUID::null), mSourceUUID(LLUUID::null),
mTargetUUID(LLUUID::null), mTargetUUID(LLUUID::null),
mInstance(NULL),
mBatchSize(gSavedSettings.getU32("LinkReplaceBatchSize")) mBatchSize(gSavedSettings.getU32("LinkReplaceBatchSize"))
{ {
mEventTimer.stop(); mEventTimer.stop();
mInstance = this;
} }
LLFloaterLinkReplace::~LLFloaterLinkReplace() LLFloaterLinkReplace::~LLFloaterLinkReplace()
{ {
mInstance = NULL;
} }
BOOL LLFloaterLinkReplace::postBuild() BOOL LLFloaterLinkReplace::postBuild()
...@@ -180,11 +177,9 @@ void LLFloaterLinkReplace::onStartClicked() ...@@ -180,11 +177,9 @@ void LLFloaterLinkReplace::onStartClicked()
} }
} }
void LLFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id, // static
const LLUUID& target_item_id, void LLFloaterLinkReplace::linkCreatedCallback(LLHandle<LLFloaterLinkReplace> floater_handle, const LLUUID& old_item_id, const LLUUID& target_item_id,
bool needs_wearable_ordering_update, bool needs_wearable_ordering_update, bool needs_description_update, const LLUUID& outfit_folder_id)
bool needs_description_update,
const LLUUID& outfit_folder_id)
{ {
LL_DEBUGS() << "Inventory link replace:" << LL_NEWLINE LL_DEBUGS() << "Inventory link replace:" << LL_NEWLINE
<< " - old_item_id = " << old_item_id.asString() << LL_NEWLINE << " - old_item_id = " << old_item_id.asString() << LL_NEWLINE
...@@ -239,20 +234,21 @@ void LLFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id, ...@@ -239,20 +234,21 @@ void LLFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id,
outfit_update_folder = outfit_folder_id; outfit_update_folder = outfit_folder_id;
} }
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::itemRemovedCallback, this, outfit_update_folder)); LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::itemRemovedCallback, floater_handle, outfit_update_folder));
remove_inventory_object(old_item_id, cb); remove_inventory_object(old_item_id, cb);
} }
void LLFloaterLinkReplace::itemRemovedCallback(const LLUUID& outfit_folder_id) // static
void LLFloaterLinkReplace::itemRemovedCallback(LLHandle<LLFloaterLinkReplace> floater_handle, const LLUUID& outfit_folder_id)
{ {
if (outfit_folder_id.notNull()) if (outfit_folder_id.notNull())
{ {
LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(outfit_folder_id); LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(outfit_folder_id);
} }
if (mInstance) if (!floater_handle.isDead())
{ {
decreaseOpenItemCount(); floater_handle.get()->decreaseOpenItemCount();
} }
} }
...@@ -324,7 +320,7 @@ void LLFloaterLinkReplace::processBatch(LLInventoryModel::item_array_t items) ...@@ -324,7 +320,7 @@ void LLFloaterLinkReplace::processBatch(LLInventoryModel::item_array_t items)
LLInventoryObject::const_object_list_t obj_array; LLInventoryObject::const_object_list_t obj_array;
obj_array.push_back(LLConstPointer<LLInventoryObject>(target_item)); obj_array.push_back(LLConstPointer<LLInventoryObject>(target_item));
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::linkCreatedCallback, LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::linkCreatedCallback,
this, getDerivedHandle<LLFloaterLinkReplace>(),
source_item->getUUID(), source_item->getUUID(),
target_item->getUUID(), target_item->getUUID(),
needs_wearable_ordering_update, needs_wearable_ordering_update,
......
...@@ -98,12 +98,9 @@ private: ...@@ -98,12 +98,9 @@ private:
void updateFoundLinks(); void updateFoundLinks();
void processBatch(LLInventoryModel::item_array_t items); void processBatch(LLInventoryModel::item_array_t items);
void linkCreatedCallback(const LLUUID& old_item_id, static void linkCreatedCallback(LLHandle<LLFloaterLinkReplace> floater_handle, const LLUUID& old_item_id, const LLUUID& target_item_id,
const LLUUID& target_item_id, bool needs_wearable_ordering_update, bool needs_description_update, const LLUUID& outfit_folder_id);
bool needs_wearable_ordering_update, static void itemRemovedCallback(LLHandle<LLFloaterLinkReplace> floater_handle, const LLUUID& outfit_folder_id);
bool needs_description_update,
const LLUUID& outfit_folder_id);
void itemRemovedCallback(const LLUUID& outfit_folder_id);
void onSourceItemDrop(const LLUUID& source_item_id); void onSourceItemDrop(const LLUUID& source_item_id);
void onTargetItemDrop(const LLUUID& target_item_id); void onTargetItemDrop(const LLUUID& target_item_id);
...@@ -120,8 +117,6 @@ private: ...@@ -120,8 +117,6 @@ private:
U32 mBatchSize; U32 mBatchSize;
LLInventoryModel::item_array_t mRemainingInventoryItems; LLInventoryModel::item_array_t mRemainingInventoryItems;
LLFloaterLinkReplace* mInstance;
}; };
#endif // LL_FLOATERLINKREPLACE_H #endif // LL_FLOATERLINKREPLACE_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment