[sldev] Multiple Leaks in the Group Dialog / VWR-908
Nicholaz Beresford
nicholaz at blueflash.cc
Wed May 30 10:41:38 PDT 2007
I just found leaks all over the place in the group dialog.
Patch attached here and with issue VWR-908 on the JIRA:
https://jira.secondlife.com/browse/VWR-908
Nick
--
Second Life from the inside out:
http://nicholaz-beresford.blogspot.com/
-------------- next part --------------
--- linden-orig/indra/newview/llpanelgroup.cpp 2007-05-23 11:56:00.000000000 +0200
+++ linden/indra/newview/llpanelgroup.cpp 2007-05-30 18:41:41.156250000 +0200
@@ -79,6 +79,7 @@
{
mHelpText = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
return TRUE;
}
@@ -286,12 +287,14 @@
{
mDefaultNeedsApplyMesg = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
txt = (LLTextBox*)getChildByName("want_apply_text");
if (txt)
{
mWantApplyMesg = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
LLButton* button = (LLButton*) getChildByName("btn_ok");
--- linden-orig/indra/newview/llpanelgroupgeneral.cpp 2007-05-23 11:56:00.000000000 +0200
+++ linden/indra/newview/llpanelgroupgeneral.cpp 2007-05-30 17:29:17.140625000 +0200
@@ -136,6 +136,7 @@
{
mFounderName = new LLNameBox(founder->getName(),founder->getRect(),LLUUID::null,FALSE,founder->getFont(),founder->getMouseOpaque());
removeChild(founder);
+ delete founder; // VWR-908 (the pointers that appear here as "founder" are left over in the leak dump) [Nicholaz]
addChild(mFounderName);
}
@@ -222,6 +223,7 @@
{
mIncompleteMemberDataStr = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that appear here as "txt" are left over in the leak dump) [Nicholaz]
}
txt = (LLTextBox*)getChildByName("confirm_group_create_str");
@@ -229,6 +231,7 @@
{
mConfirmGroupCreateStr = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that appear here as "txt" are left over in the leak dump) [Nicholaz]
}
// If the group_id is null, then we are creating a new group
--- linden-orig/indra/newview/llpanelgrouproles.cpp 2007-05-23 11:56:00.000000000 +0200
+++ linden/indra/newview/llpanelgrouproles.cpp 2007-05-30 18:03:30.437500000 +0200
@@ -173,12 +173,14 @@
{
mDefaultNeedsApplyMesg = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
txt = (LLTextBox*)getChildByName("want_apply_text");
if (txt)
{
mWantApplyMesg = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
return LLPanelGroupTab::postBuild();
@@ -542,6 +544,8 @@
{
mActionIcons["folder"] = icon->getImage();
removeChild(icon);
+ delete icon; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
+
}
icon = (LLIconCtrl*) getChildByName("power_all_have_icon",no_recurse);
@@ -549,6 +553,8 @@
{
mActionIcons["full"] = icon->getImage();
removeChild(icon);
+ delete icon; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
+
}
icon = (LLIconCtrl*) getChildByName("power_partial_icon",no_recurse);
@@ -556,6 +562,7 @@
{
mActionIcons["partial"] = icon->getImage();
removeChild(icon);
+ delete icon; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
return LLPanelGroupTab::postBuild();
@@ -1826,6 +1833,7 @@
{
mRemoveEveryoneTxt = txt->getText();
parent->removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
mCreateRoleButton =
--- linden-orig/indra/newview/llpanelgroupvoting.cpp 2007-05-23 11:56:00.000000000 +0200
+++ linden/indra/newview/llpanelgroupvoting.cpp 2007-05-30 18:03:30.500000000 +0200
@@ -1300,6 +1300,7 @@
{
mImpl->mViewProposalHeaderText = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
txt = (LLTextBox*) getChildByName("proposals_header_create_txt", recurse);
@@ -1307,6 +1308,7 @@
{
mImpl->mCreateProposalHeaderText = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
txt = (LLTextBox*) getChildByName("proposals_header_vote_txt", recurse);
@@ -1314,6 +1316,7 @@
{
mImpl->mVoteProposalHeaderText = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
txt = (LLTextBox*) getChildByName("empty_proposal_txt", recurse);
@@ -1321,6 +1324,7 @@
{
mImpl->mEmptyProposalText = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
mImpl->updateQuorumText();
--- linden-orig/indra/newview/llpanelgroupnotices.cpp 2007-05-23 11:56:00.000000000 +0200
+++ linden/indra/newview/llpanelgroupnotices.cpp 2007-05-30 18:36:10.062500000 +0200
@@ -280,6 +280,7 @@
{
mNoNoticesStr = txt->getText();
removeChild(txt);
+ delete txt; // VWR-908 (should most likely be deleted, but not dump-verified) [Nicholaz]
}
mPanelCreateNotice = (LLPanel*) getChildByName("panel_create_new_notice",recurse);
@@ -295,6 +296,8 @@
mPanelCreateNotice->addChild(target);
mPanelCreateNotice->removeChild(dtv);
+ delete dtv; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
+
arrangeNoticeView(VIEW_PAST_NOTICE);
--- linden-orig/indra/newview/llpanelgrouplandmoney.cpp 2007-05-23 11:56:00.000000000 +0200
+++ linden/indra/newview/llpanelgrouplandmoney.cpp 2007-05-30 19:23:55.875000000 +0200
@@ -130,9 +130,22 @@
LLPanelGroupLandMoney::impl::~impl()
{
- if ( mMoneySalesTabEHp ) delete mMoneySalesTabEHp;
- if ( mMoneyDetailsTabEHp ) delete mMoneyDetailsTabEHp;
- if ( mMoneyPlanningTabEHp ) delete mMoneyPlanningTabEHp;
+ // PATCH : VWR-908 (some safety and cosmetic: reset deleted pointers) [Nicholaz]
+ if ( mMoneySalesTabEHp ) {
+ delete mMoneySalesTabEHp;
+ mMoneySalesTabEHp = NULL;
+ }
+
+ if ( mMoneyDetailsTabEHp ) {
+ delete mMoneyDetailsTabEHp;
+ mMoneyDetailsTabEHp = NULL;
+ }
+
+ if ( mMoneyPlanningTabEHp ) {
+ delete mMoneyPlanningTabEHp;
+ mMoneyPlanningTabEHp = NULL;
+ }
+ // ~PATCH
}
void LLPanelGroupLandMoney::impl::requestGroupLandInfo()
@@ -570,6 +583,7 @@
{
mImplementationp->mCantViewParcelsText = no_permsp->getText();
removeChild(no_permsp);
+ delete no_permsp; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
no_permsp = (LLTextBox*) getChildByName("cant_view_group_accounting_text");
@@ -577,6 +591,7 @@
{
mImplementationp->mCantViewAccountsText = no_permsp->getText();
removeChild(no_permsp);
+ delete no_permsp; // VWR-908 (the pointers that are removed here are left over in the leak dump) [Nicholaz]
}
@@ -646,13 +661,25 @@
}
else
{
- mImplementationp->mMoneyDetailsTabEHp =
- new LLGroupMoneyDetailsTabEventHandler(earlierp,
+ // PATCH
+ //
+ // VWR-908 : postBuild seems to be called twice through the factory
+ // resulting in double allocation and losing the first object
+ // there are other possible fixes:
+ // - avoid being called twice (preferrable)
+ // - allocate only if pointer still NULL (done here)
+ // - delete pointer before allocating newly
+ if ( mImplementationp->mMoneyDetailsTabEHp == NULL ) {
+
+ mImplementationp->mMoneyDetailsTabEHp =
+ new LLGroupMoneyDetailsTabEventHandler(earlierp,
laterp,
textp,
tabcp,
panelp,
mGroupID);
+ }
+ // ~PATCH
}
textp = (LLTextEditor*) getChildByName("group_money_planning_text", true);
@@ -664,11 +691,23 @@
}
else
{
- mImplementationp->mMoneyPlanningTabEHp =
- new LLGroupMoneyPlanningTabEventHandler(textp,
+ // PATCH
+ //
+ // VWR-908 : postBuild seems to be called twice through the factory
+ // resulting in double allocation and losing the first object
+ // there are other possible fixes:
+ // - avoid being called twice (preferrable)
+ // - allocate only if pointer still NULL (done here)
+ // - delete pointer before allocating newly
+ if ( mImplementationp->mMoneyPlanningTabEHp == NULL ) {
+
+ mImplementationp->mMoneyPlanningTabEHp =
+ new LLGroupMoneyPlanningTabEventHandler(textp,
tabcp,
panelp,
mGroupID);
+ }
+ // ~PATCH
}
//pull out the widgets for the L$ sales tab
@@ -683,13 +722,25 @@
}
else
{
- mImplementationp->mMoneySalesTabEHp =
- new LLGroupMoneySalesTabEventHandler(earlierp,
+ // PATCH
+ //
+ // VWR-908 : postBuild seems to be called twice through the factory
+ // resulting in double allocation and losing the first object
+ // there are other possible fixes:
+ // - avoid being called twice (preferrable)
+ // - allocate only if pointer still NULL (done here)
+ // - delete pointer before allocating newly
+ if ( mImplementationp->mMoneySalesTabEHp == NULL ) {
+
+ mImplementationp->mMoneySalesTabEHp =
+ new LLGroupMoneySalesTabEventHandler(earlierp,
laterp,
textp,
tabcp,
panelp,
mGroupID);
+ }
+ // ~PATCH
}
return LLPanelGroupTab::postBuild();
More information about the SLDev
mailing list