Chromium Code Reviews| Index: base/memory/scoped_ptr.h |
| diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h |
| index 1067d428380135cd8d9be4f19d882d6b63c33f5c..5ac6846f3964e2ea929cef92d065454f23a64a4a 100644 |
| --- a/base/memory/scoped_ptr.h |
| +++ b/base/memory/scoped_ptr.h |
| @@ -285,7 +285,7 @@ class scoped_ptr_malloc { |
| // Destructor. If there is a C object, call the Free functor. |
| ~scoped_ptr_malloc() { |
| - free_(ptr_); |
| + reset(); |
| } |
| // Reset. Calls the Free functor on the current owned object, if any. |
| @@ -293,7 +293,8 @@ class scoped_ptr_malloc { |
| // this->reset(this->get()) works. |
| void reset(C* p = NULL) { |
| if (ptr_ != p) { |
| - free_(ptr_); |
| + FreeProc free_proc; |
|
darin (slow to review)
2011/08/29 23:32:10
unrelated to this change, but since free_proc(ptr_
|
| + free_proc(ptr_); |
| ptr_ = p; |
| } |
| } |
| @@ -355,16 +356,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); |