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

Unified Diff: base/scoped_ptr.h

Issue 3031001: str_ptr_malloc: The simple solution (Closed)
Patch Set: rebased Created 10 years, 5 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_ptr.h
diff --git a/base/scoped_ptr.h b/base/scoped_ptr.h
index c716e7722f336ae0a89df618903e4d0a950fe6ac..f470cd37eafe7e94ec68ef19b71a77736e6adefd 100644
--- a/base/scoped_ptr.h
+++ b/base/scoped_ptr.h
@@ -284,7 +284,7 @@ class scoped_ptr_malloc {
// Destructor. If there is a C object, call the Free functor.
~scoped_ptr_malloc() {
- free_(ptr_);
+ FreeProc()(ptr_);
}
// Reset. Calls the Free functor on the current owned object, if any.
@@ -292,7 +292,7 @@ class scoped_ptr_malloc {
// this->reset(this->get()) works.
void reset(C* p = NULL) {
if (ptr_ != p) {
- free_(ptr_);
+ FreeProc()(ptr_);
ptr_ = p;
}
}
@@ -354,16 +354,11 @@ class scoped_ptr_malloc {
template <class C2, class GP>
bool operator!=(scoped_ptr_malloc<C2, GP> const& p) const;
- static FreeProc const free_;
-
// Disallow evil constructors
scoped_ptr_malloc(const scoped_ptr_malloc&);
void operator=(const scoped_ptr_malloc&);
};
-template<class C, class FP>
-FP const scoped_ptr_malloc<C, FP>::free_ = FP();
-
template<class C, class FP> inline
void swap(scoped_ptr_malloc<C, FP>& a, scoped_ptr_malloc<C, FP>& b) {
a.swap(b);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698