Index: base/memory/ref_counted.h |
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h |
index b7cb5e064175466d747e5ae66125262d8f1558cf..cf8ff1688dc7f4de093f78d15a17a1fade0ed0fe 100644 |
--- a/base/memory/ref_counted.h |
+++ b/base/memory/ref_counted.h |
@@ -6,6 +6,8 @@ |
#define BASE_MEMORY_REF_COUNTED_H_ |
#pragma once |
+#include <cassert> |
+ |
#include "base/atomic_ref_count.h" |
#include "base/base_export.h" |
#include "base/threading/thread_collision_warner.h" |
@@ -243,7 +245,10 @@ class scoped_refptr { |
T* get() const { return ptr_; } |
operator T*() const { return ptr_; } |
- T* operator->() const { return ptr_; } |
+ T* operator->() const { |
+ assert(ptr_ != NULL); |
jar (doing other things)
2012/01/28 02:47:22
Could you clarify when this would be significant?
|
+ return ptr_; |
+ } |
// Release a pointer. |
// The return value is the current pointer held by this object. |