Re: Commit: Re: patch: one-liner for 1134


Subject: Re: Commit: Re: patch: one-liner for 1134
From: Patrick Lam (plam@plam.lcs.mit.edu)
Date: Fri Mar 30 2001 - 15:23:25 CST


All right, here's a patch to replace occurences of delete
m_psz... with delete[] m_psz...

I checked, by the way, that this string does always get freed, and isn't
improperly freed. Looks fine. [Garbage collection is such a good thing!]

Does someone want to close 1134?

pat

Index: src/wp/ap/xp/ap_Dialog_Tab.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Tab.cpp,v
retrieving revision 1.15
diff -u -r1.15 ap_Dialog_Tab.cpp
--- src/wp/ap/xp/ap_Dialog_Tab.cpp 2001/03/30 06:20:47 1.15
+++ src/wp/ap/xp/ap_Dialog_Tab.cpp 2001/03/30 21:22:59
@@ -47,7 +47,7 @@
 
 AP_Dialog_Tab::~AP_Dialog_Tab(void)
 {
- delete m_pszTabStops;
+ delete[] m_pszTabStops;
         UT_VECTOR_PURGEALL(fl_TabStop *, m_tabInfo);
 }
 
@@ -248,7 +248,7 @@
                 strcat(p_temp, ",");
         }
         strcat(p_temp, buffer);
- delete m_pszTabStops;
+ delete[] m_pszTabStops;
         m_pszTabStops = p_temp;
 
         UT_ASSERT(m_pFrame); // needs to be set from runModal for some of the event_'s to work
@@ -323,7 +323,7 @@
 
         FV_View *pView = (FV_View *)m_pFrame->getCurrentView();
 
- delete m_pszTabStops;
+ delete[] m_pszTabStops;
         m_pszTabStops = new char [1]; m_pszTabStops[0] = 0;
         buildTabStops(pView->getGraphics(), m_pszTabStops, m_tabInfo);
 



This archive was generated by hypermail 2b25 : Fri Mar 30 2001 - 15:30:04 CST