Commit 61d14eb7 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Don't release the unique_ptr so it clears memory

ServiceWorkerResponse type doesn't provide move constructor nor
assignment, thus when moving to vector it creates a copy, so we need
unique_ptr to delete the memory used by its value, otherwise it leaks.

Bug: 835611
Change-Id: I1276b5e3935f9759b8d9dd84df3a958b1dd9d25e
Reviewed-on: https://chromium-review.googlesource.com/1023731Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Luciano Pacheco (SYD) <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553473}
parent ae5e45c0
......@@ -152,7 +152,7 @@ class CacheStorageDispatcherHost::CacheImpl
std::vector<ServiceWorkerResponse> responses;
if (error == CacheStorageError::kSuccess) {
DCHECK(response);
responses.push_back(std::move(*response.release()));
responses.push_back(std::move(*response));
}
OnCacheMatchAllCallback(std::move(callback), std::move(cache_handle), error,
std::move(responses));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment