* CID-1741: remove useless piece of code that did nothing but leak the label

* don't check against NULL before deleting fLabel

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38184 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2010-08-17 13:56:23 +00:00
parent f7502de1bb
commit 6effcf12f2

View File

@ -17,7 +17,7 @@
CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 flags,float min_width) CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 flags,float min_width)
{ {
fPopup = popup; fPopup = popup;
if(flags & CLV_EXPANDER) if(flags & CLV_EXPANDER)
{ {
label = NULL; label = NULL;
@ -31,12 +31,6 @@ CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 fla
if(width < min_width) if(width < min_width)
width = min_width; width = min_width;
if(label) if(label)
{
char* Temp = new char[strlen(label)+1];
strcpy(Temp,label);
label = Temp;
}
if(label)
{ {
fLabel = new char[strlen(label)+1]; fLabel = new char[strlen(label)+1];
strcpy((char*)fLabel,label); strcpy((char*)fLabel,label);
@ -54,9 +48,9 @@ CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 fla
CLVColumn::~CLVColumn() CLVColumn::~CLVColumn()
{ {
if(fLabel) delete[] fLabel; delete [] fLabel;
if(fParent) fParent->RemoveColumn(this); if(fParent) fParent->RemoveColumn(this);
delete fPopup; delete fPopup;
} }
@ -136,7 +130,7 @@ void CLVColumn::SetWidth(float width)
DestArea.left = fColumnEnd + Delta; DestArea.left = fColumnEnd + Delta;
DestArea.right = DestArea.left; DestArea.right = DestArea.left;
fParent->fColumnLabelView->Invalidate(DestArea); fParent->fColumnLabelView->Invalidate(DestArea);
//Update the column sizes, positions and group positions //Update the column sizes, positions and group positions
fParent->UpdateColumnSizesDataRectSizeScrollBars(); fParent->UpdateColumnSizesDataRectSizeScrollBars();
fParent->fColumnLabelView->UpdateDragGroups(); fParent->fColumnLabelView->UpdateDragGroups();