From: david Date: Wed, 27 Mar 2002 11:42:09 +0000 (+0000) Subject: Patch from Melchior Franz: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d0d7878e0a4cc7871276db37517faf0c61693740;p=simgear.git Patch from Melchior Franz: This module works mostly with char* and allocates memory with strdup ... delete doesn't go well with malloc(). The transition to string only would be nice, but some class interfaces return char*, so it was more natural to just drop the deletes. --- diff --git a/simgear/timing/sg_time.cxx b/simgear/timing/sg_time.cxx index e87d1947..d2823b77 100644 --- a/simgear/timing/sg_time.cxx +++ b/simgear/timing/sg_time.cxx @@ -136,7 +136,7 @@ SGTime::~SGTime() if ( zonename != NULL ) { char *tmp = zonename; zonename = NULL; - delete tmp; + free(tmp); } } @@ -302,7 +302,7 @@ void SGTime::updateLocal( double lon, double lat, const string& root ) { if ( zonename ) { char *ptr = zonename; zonename = NULL; - delete ptr; + free(ptr); } zonename = strdup( zone.c_str() );