Index: crypto/scoped_capi_types.h |
diff --git a/crypto/scoped_capi_types.h b/crypto/scoped_capi_types.h |
index f565121059da687b3d5c3ac532435cfc9603aafd..51e2f72eb6c37f0f38e31968b4163369f9420085 100644 |
--- a/crypto/scoped_capi_types.h |
+++ b/crypto/scoped_capi_types.h |
@@ -51,12 +51,13 @@ class ScopedCAPIHandle { |
explicit ScopedCAPIHandle(CAPIHandle handle = NULL) : handle_(handle) {} |
~ScopedCAPIHandle() { |
- free_(handle_); |
+ reset(); |
wtc
2011/08/31 21:15:28
Just to make sure I understand this correctly: thi
|
} |
void reset(CAPIHandle handle = NULL) { |
if (handle_ != handle) { |
- free_(handle_); |
+ FreeProc free_proc; |
+ free_proc(handle_); |
handle_ = handle; |
} |
} |
@@ -91,14 +92,10 @@ class ScopedCAPIHandle { |
private: |
CAPIHandle handle_; |
- static const FreeProc free_; |
DISALLOW_COPY_AND_ASSIGN(ScopedCAPIHandle); |
}; |
-template<class CH, typename FP> |
-const FP ScopedCAPIHandle<CH, FP>::free_ = FP(); |
- |
template<class CH, typename FP> inline |
bool operator==(CH h, const ScopedCAPIHandle<CH, FP>& b) { |
return h == b.get(); |