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 corruptionBjörn Persson16 Aug
  • Re: Crashes and memory corruptionWarren Young16 Aug
    • Re: Crashes and memory corruptionBjörn Persson17 Aug
      • Re: Crashes and memory corruptionWarren Young17 Aug
        • Re: Crashes and memory corruptionBjörn Persson18 Aug
          • Re: Crashes and memory corruptionThomas Werth18 Aug
          • Re: Crashes and memory corruptionWarren Young18 Aug
        • Re: Crashes and memory corruptionBjörn Persson25 Nov
          • Re: Crashes and memory corruptionWarren Young15 Dec
            • Re: Crashes and memory corruptionBjörn Persson15 Dec
Re: Crashes and memory corruptionJan Busch20 Dec
  • Re: Crashes and memory corruptionChris Frey20 Dec
Re: Crashes and memory corruptionJan Busch21 Dec