From 6effcf12f293047a2253fa49a5543830d0b38909 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 17 Aug 2010 13:56:23 +0000 Subject: [PATCH] * 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 --- src/preferences/shortcuts/clv/CLVColumn.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/preferences/shortcuts/clv/CLVColumn.cpp b/src/preferences/shortcuts/clv/CLVColumn.cpp index c53d633c4b..ed88dc2976 100644 --- a/src/preferences/shortcuts/clv/CLVColumn.cpp +++ b/src/preferences/shortcuts/clv/CLVColumn.cpp @@ -17,7 +17,7 @@ CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 flags,float min_width) { fPopup = popup; - + if(flags & CLV_EXPANDER) { label = NULL; @@ -31,12 +31,6 @@ CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 fla if(width < min_width) width = min_width; if(label) - { - char* Temp = new char[strlen(label)+1]; - strcpy(Temp,label); - label = Temp; - } - if(label) { fLabel = new char[strlen(label)+1]; strcpy((char*)fLabel,label); @@ -54,9 +48,9 @@ CLVColumn::CLVColumn(const char* label,BPopUpMenu * popup,float width,uint32 fla CLVColumn::~CLVColumn() { - if(fLabel) delete[] fLabel; + delete [] fLabel; if(fParent) fParent->RemoveColumn(this); - delete fPopup; + delete fPopup; } @@ -136,7 +130,7 @@ void CLVColumn::SetWidth(float width) DestArea.left = fColumnEnd + Delta; DestArea.right = DestArea.left; fParent->fColumnLabelView->Invalidate(DestArea); - + //Update the column sizes, positions and group positions fParent->UpdateColumnSizesDataRectSizeScrollBars(); fParent->fColumnLabelView->UpdateDragGroups();