Skip to content

Commit c8d08ee

Browse files
committed
#4931 Fix name cache callbacks not having connections
1 parent 695203b commit c8d08ee

10 files changed

+26
-7
lines changed

indra/newview/llconversationlog.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ void LLConversation::setListenIMFloaterOpened()
157157
// if floater is already opened or this conversation doesn't have unread offline messages
158158
if (mHasOfflineIMs && !offline_ims_visible)
159159
{
160-
mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1));
160+
mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback([this](const LLUUID& session_id)
161+
{
162+
onIMFloaterShown(session_id);
163+
});
161164
}
162165
else
163166
{

indra/newview/llconversationloglistitem.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ LLConversationLogListItem::LLConversationLogListItem(const LLConversation* conve
5353

5454
if (mConversation->hasOfflineMessages() && !ims_are_read)
5555
{
56-
mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversationLogListItem::onIMFloaterShown, this, _1));
56+
mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback([this](const LLUUID& session_id)
57+
{
58+
onIMFloaterShown(session_id);
59+
});
5760
}
5861
}
5962

indra/newview/llfloaterexperiences.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void LLFloaterExperiences::onOpen( const LLSD& key )
171171
refreshContents();
172172
return;
173173
}
174-
region->setCapabilitiesReceivedCallback(boost::bind(&LLFloaterExperiences::refreshContents, this));
174+
mCapsReceivedConnection = region->setCapabilitiesReceivedCallback(boost::bind(&LLFloaterExperiences::refreshContents, this));
175175
return;
176176
}
177177
}
@@ -231,6 +231,7 @@ bool LLFloaterExperiences::updatePermissions( const LLSD& permission )
231231

232232
void LLFloaterExperiences::onClose( bool app_quitting )
233233
{
234+
mCapsReceivedConnection.disconnect();
234235
LLEventPumps::instance().obtain("experience_permission").stopListening("LLFloaterExperiences");
235236
LLFloater::onClose(app_quitting);
236237
}

indra/newview/llfloaterexperiences.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class LLFloaterExperiences :
7171
static void retrieveExperienceListCoro(std::string url, LLHandle<LLFloaterExperiences> hparent,
7272
NameMap_t tabMapping, std::string errorNotify, Callback_t cback, invokationFn_t invoker);
7373
std::vector<LLUUID> mPrepurchaseIds;
74+
boost::signals2::scoped_connection mCapsReceivedConnection;
7475
};
7576

7677
#endif //LL_LLFLOATEREXPERIENCES_H

indra/newview/llfloaterscriptlimits.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,13 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
487487
names_requested.push_back(owner_id);
488488
if (is_group_owned)
489489
{
490-
gCacheName->getGroup(owner_id,
490+
mGroupNameCacheConnection = gCacheName->getGroup(owner_id,
491491
boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache,
492492
this, _1, _2));
493493
}
494494
else
495495
{
496-
LLAvatarNameCache::get(owner_id,
496+
mAvatarNameCacheConnection = LLAvatarNameCache::get(owner_id,
497497
boost::bind(&LLPanelScriptLimitsRegionMemory::onAvatarNameCache,
498498
this, _1, _2));
499499
}

indra/newview/llfloaterscriptlimits.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ class LLPanelScriptLimitsRegionMemory : public LLPanelScriptLimitsInfo, LLRemote
136136

137137
std::vector<LLSD> mObjectListItems;
138138

139+
boost::signals2::scoped_connection mAvatarNameCacheConnection;
140+
boost::signals2::scoped_connection mGroupNameCacheConnection;
141+
139142
void getLandScriptResourcesCoro(std::string url);
140143
void getLandScriptSummaryCoro(std::string url);
141144
void getLandScriptDetailsCoro(std::string url);

indra/newview/llpanelprofile.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,10 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife()
710710
{
711711
mAvatarNameCacheConnection.disconnect();
712712
}
713+
if (mMenuNameCacheConnection.connected())
714+
{
715+
mMenuNameCacheConnection.disconnect();
716+
}
713717
}
714718

715719
bool LLPanelProfileSecondLife::postBuild()
@@ -1458,7 +1462,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata)
14581462
}
14591463
else if (item_name == "edit_display_name")
14601464
{
1461-
LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCacheSetName, this, _1, _2));
1465+
mMenuNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCacheSetName, this, _1, _2));
14621466
LLFirstUse::setDisplayName(false);
14631467
}
14641468
else if (item_name == "edit_partner")

indra/newview/llpanelprofile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ class LLPanelProfileSecondLife
212212
bool mAllowEdit;
213213
std::string mDescriptionText;
214214
boost::signals2::connection mAvatarNameCacheConnection;
215+
boost::signals2::connection mMenuNameCacheConnection;
215216
};
216217

217218

indra/newview/llspeakers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void LLSpeaker::lookupName()
7676
{
7777
if (mDisplayName.empty())
7878
{
79-
LLAvatarNameCache::get(mID, boost::bind(&LLSpeaker::onNameCache, this, _1, _2)); // todo: can be group???
79+
mAvatarNameCacheConnection = LLAvatarNameCache::get(mID, boost::bind(&LLSpeaker::onNameCache, this, _1, _2)); // todo: can be group???
8080
}
8181
}
8282

indra/newview/llspeakers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LL
8080
bool mIsModerator;
8181
bool mModeratorMutedVoice;
8282
bool mModeratorMutedText;
83+
84+
private:
85+
boost::signals2::scoped_connection mAvatarNameCacheConnection;
8386
};
8487

8588
class LLSpeakerUpdateSpeakerEvent : public LLOldEvents::LLEvent

0 commit comments

Comments
 (0)