Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: webkit/dom_storage/dom_storage_context.cc

Issue 11458003: Remove scoped_refptr::release which is confusing and causes leaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: duh Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/occlusion_tracker_unittest.cc ('K') | « net/disk_cache/backend_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_context.cc
diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc
index 6a67e8a5ea02a01d2525c66f05b908e61e8b3f85..3d32243c221f609a929f2098c783d8be941c7856 100644
--- a/webkit/dom_storage/dom_storage_context.cc
+++ b/webkit/dom_storage/dom_storage_context.cc
@@ -46,14 +46,15 @@ DomStorageContext::~DomStorageContext() {
if (session_storage_database_.get()) {
// SessionStorageDatabase shouldn't be deleted right away: deleting it will
// potentially involve waiting in leveldb::DBImpl::~DBImpl, and waiting
- // shouldn't happen on this thread. This will unassign the ref counted
- // pointer without decreasing the ref count, and is balanced by the Release
- // that happens later.
+ // shouldn't happen on this thread.
+ SessionStorageDatabase* to_release = session_storage_database_.get();
+ to_release->AddRef();
+ session_storage_database_ = NULL;
task_runner_->PostShutdownBlockingTask(
FROM_HERE,
DomStorageTaskRunner::COMMIT_SEQUENCE,
base::Bind(&SessionStorageDatabase::Release,
- base::Unretained(session_storage_database_.release())));
+ base::Unretained(to_release)));
}
}
« cc/occlusion_tracker_unittest.cc ('K') | « net/disk_cache/backend_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698