diff options
author | Narayan Kamath <narayan@google.com> | 2015-02-23 15:43:35 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2015-02-23 15:49:43 +0000 |
commit | 6832a7a4e04c84192f0bafc6ac990fc79cd13882 (patch) | |
tree | e8c0940ae4a25e96db0ad84985991731f2b1b8f4 /libziparchive | |
parent | f1ac6917da172dd3e6829bac41fcbf23e96da079 (diff) | |
download | core-6832a7a4e04c84192f0bafc6ac990fc79cd13882.tar.gz core-6832a7a4e04c84192f0bafc6ac990fc79cd13882.tar.bz2 core-6832a7a4e04c84192f0bafc6ac990fc79cd13882.zip |
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
Diffstat (limited to 'libziparchive')
-rw-r--r-- | libziparchive/zip_archive.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc index afc122dc4..ebbab9f21 100644 --- a/libziparchive/zip_archive.cc +++ b/libziparchive/zip_archive.cc @@ -321,9 +321,7 @@ struct ZipArchive { close(fd); } - if (directory_map != NULL) { - directory_map->release(); - } + delete directory_map; free(hash_table); } }; @@ -335,7 +333,7 @@ static android::FileMap* MapFileSegment(const int fd, const off64_t start, 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 @@ int32_t ExtractEntryToFile(ZipArchiveHandle handle, const int32_t error = ExtractToMemory(handle, entry, reinterpret_cast<uint8_t*>(map->getDataPtr()), map->getDataLength()); - map->release(); + delete map; return error; } |