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.
This commit is contained in:
@@ -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() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user