Remove useless refCounting from FileMap.
Nobody ever called acquire() so release() was always
equivalent to delete. Just use delete instead so that
people can use unique_ptr directly (or shared_ptr if
they really want refcounts).
Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index afc122d..ebbab9f 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -321,9 +321,7 @@
close(fd);
}
- if (directory_map != NULL) {
- directory_map->release();
- }
+ delete directory_map;
free(hash_table);
}
};
@@ -335,7 +333,7 @@
android::FileMap* file_map = new android::FileMap;
const bool success = file_map->create(debug_file_name, fd, start, length, read_only);
if (!success) {
- file_map->release();
+ delete file_map;
return NULL;
}
@@ -1170,7 +1168,7 @@
const int32_t error = ExtractToMemory(handle, entry,
reinterpret_cast<uint8_t*>(map->getDataPtr()),
map->getDataLength());
- map->release();
+ delete map;
return error;
}