Commit: Re: More memory bugs


Subject: Commit: Re: More memory bugs
From: Dom Lachowicz (cinamod@hotmail.com)
Date: Sun Mar 18 2001 - 12:00:14 CST


Fixed this bug. Sorry 'bout that - sometimes things like that unfortunately
slip through, no matter who writes the code.

I have also added DELETEPV(p) which is a vector/array form of DELETEP.

Dom

>From: "Mike Nordell" <tamlin@algonet.se>
>To: "AbiWord-dev" <abiword-dev@abisource.com>
>Subject: More memory bugs
>Date: Sun, 18 Mar 2001 07:41:15 +0100
>
>Instead of just quietly fixing this, I had to go on ranting about it.
>
>ev_Menu_Labels.cpp v. 1.16 got a nasty bug. Potentially a killer if left
>as-is. Even Dom that updated that file to 1.17 missed that bug. May I
>humbly
>suggest that if using strings in this way, and don't know the difference
>between malloc/calloc & new, use the string class UT_String I added.
>
>I've apparently forgotten how challanging memory management can be to some,
>why I after seeing this bug reintroduced for the 4711:th time suggests that
>this micro-management of memory should be forwarded to some entity that
>ease
>the burden off you: UT_String. I actually think we should throw
>UT_cloneString away and never look back.
>
>Even _if_ UT_cloneString would have used new[] to allocate the memory
>returned this would corrupt the heap and crash (if _lucky_ that is) since
>DELETEP uses _plain_ "delete", not the vector version.
>
>/Mike - don't cc
>
>
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com



This archive was generated by hypermail 2b25 : Sun Mar 18 2001 - 12:00:55 CST