| List: | MySQL++ | « Previous MessageNext Message » | |
| From: | Chris Frey | Date: | December 20 2005 9:18pm |
| Subject: | Re: Crashes and memory corruption | ||
| View as plain text | |||
On Tue, Dec 20, 2005 at 08:45:58PM +0100, Jan Busch wrote: > The problem is, that "names_" and "types_" are not neccessayrily > initialized with "new". > > Since I changed the code like this: > > " *if* (names_) > { > *delete* names_; > names_ = 0; > } > > *if* (types_) > { > *delete* types_; > types_ = 0; > } If the if statements fix a crash, then the bug is somewhere else. Doing: Object *ptr = 0; [some code] delete ptr; ptr = 0; ... is valid C++. What compiler are you using? - Chris
| Thread | ||
|---|---|---|
| • Crashes and memory corruption | Björn Persson | 16 Aug |
| • Re: Crashes and memory corruption | Warren Young | 16 Aug |
| • Re: Crashes and memory corruption | Björn Persson | 17 Aug |
| • Re: Crashes and memory corruption | Warren Young | 17 Aug |
| • Re: Crashes and memory corruption | Björn Persson | 18 Aug |
| • Re: Crashes and memory corruption | Thomas Werth | 18 Aug |
| • Re: Crashes and memory corruption | Warren Young | 18 Aug |
| • Re: Crashes and memory corruption | Björn Persson | 25 Nov |
| • Re: Crashes and memory corruption | Warren Young | 15 Dec |
| • Re: Crashes and memory corruption | Björn Persson | 15 Dec |
| • Re: Crashes and memory corruption | Jan Busch | 20 Dec |
| • Re: Crashes and memory corruption | Chris Frey | 20 Dec |
| • Re: Crashes and memory corruption | Jan Busch | 21 Dec |
