[haiku-commits] r38184 - haiku/trunk/src/preferences/shortcuts/clv

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 17 Aug 2010 15:56:23 +0200 (CEST)

Author: zooey
Date: 2010-08-17 15:56:23 +0200 (Tue, 17 Aug 2010)
New Revision: 38184
Changeset: http://dev.haiku-os.org/changeset/38184

Modified:
   haiku/trunk/src/preferences/shortcuts/clv/CLVColumn.cpp
Log:
* CID-1741: remove useless piece of code that did nothing but leak the label
* don't check against NULL before deleting fLabel

Modified: haiku/trunk/src/preferences/shortcuts/clv/CLVColumn.cpp
===================================================================
--- haiku/trunk/src/preferences/shortcuts/clv/CLVColumn.cpp     2010-08-17 
13:49:52 UTC (rev 38183)
+++ haiku/trunk/src/preferences/shortcuts/clv/CLVColumn.cpp     2010-08-17 
13:56:23 UTC (rev 38184)
@@ -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;
@@ -32,12 +32,6 @@
                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()
 {
-       if(fLabel) delete[] fLabel;
+       delete [] fLabel;
        if(fParent) fParent->RemoveColumn(this);
-    delete fPopup;     
+    delete fPopup;
 }
 
 
@@ -136,7 +130,7 @@
                                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();


Other related posts:

  • » [haiku-commits] r38184 - haiku/trunk/src/preferences/shortcuts/clv - zooey