Skip to content

Commit

Permalink
use proper delete methods as suggested by chriso in kuno#44
Browse files Browse the repository at this point in the history
  • Loading branch information
sajal committed Nov 11, 2012
1 parent 9d9baed commit 9aff74d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/city.cc
Expand Up @@ -83,7 +83,7 @@ Handle<Value> geoip::City::lookupSync(const Arguments &args) {
GeoIPRecord * record = GeoIP_record_by_ipnum(c->db, ipnum);

if (record == NULL) {
delete record;
GeoIPRecord_delete(record);
return scope.Close(Null()); //return ThrowException(String::New("Error: Can not find match data"));
}

Expand Down Expand Up @@ -142,7 +142,7 @@ Handle<Value> geoip::City::lookupSync(const Arguments &args) {
}
}

delete record;
GeoIPRecord_delete(record);
return scope.Close(data);
}

Expand Down
4 changes: 2 additions & 2 deletions src/region.cc
Expand Up @@ -87,10 +87,10 @@ Handle<Value> geoip::Region::lookupSync(const Arguments &args) {
if (region != NULL) {
data->Set(String::NewSymbol("country_code"), String::New(region->country_code));
data->Set(String::NewSymbol("region"), String::New(region->region));
delete region;
GeoIPRegion_delete(region);
return scope.Close(data);
} else {
delete region;
GeoIPRegion_delete(region);
return scope.Close(ThrowException(String::New("Error: Can not find match data")));
}
}
Expand Down

0 comments on commit 9aff74d

Please sign in to comment.