More bandaids to avoid #1309

Even though we only bind the shared_ptr in the after callback, the
worker thread was still copying the callback and therefore gaining
a shared reference. Here we try to eliminate the copies.
This commit is contained in:
John Firebaugh
2015-05-01 17:14:06 -04:00
parent dac4b7d3c9
commit 24695f6c02
5 changed files with 15 additions and 15 deletions

View File

@@ -131,7 +131,7 @@ void SQLiteCache::get(const Resource &resource, Callback callback) {
// Will try to load the URL from the SQLite database and call the callback when done.
// Note that the callback is probably going to invoked from another thread, so the caller
// must make sure that it can run in that thread.
thread->invokeWithResult(&Impl::get, callback, resource);
thread->invokeWithResult(&Impl::get, std::move(callback), resource);
}
std::unique_ptr<Response> SQLiteCache::Impl::get(const Resource &resource) {