From 24695f6c0274cac8ae17df3765e0cc54c5668047 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 1 May 2015 17:14:06 -0400 Subject: 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. --- platform/default/sqlite_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/default/sqlite_cache.cpp') diff --git a/platform/default/sqlite_cache.cpp b/platform/default/sqlite_cache.cpp index 6ba21c2813..83d42d5a5c 100644 --- a/platform/default/sqlite_cache.cpp +++ b/platform/default/sqlite_cache.cpp @@ -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 SQLiteCache::Impl::get(const Resource &resource) { -- cgit v1.2.1