Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal
diff options
context:
space:
mode:
authorPhil Nash2012-07-28 20:37:07 +0100
committerPhil Nash2012-07-28 20:37:07 +0100
commit61756974d0246b2bba4b030d96e1d4d46982be04 (patch)
treeef69e193f3d5c1526c031623ef27357b3f88c566 /include/internal
parentb084562b3bd213da3cd9e422a2343073d8e34d11 (diff)
downloadcatch3-61756974d0246b2bba4b030d96e1d4d46982be04.tar.gz
Catches incorrect reporter name as per #107
Diffstat (limited to 'include/internal')
-rw-r--r--include/internal/catch_ptr.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/internal/catch_ptr.hpp b/include/internal/catch_ptr.hpp
index 3ebe9f74..73e53ac9 100644
--- a/include/internal/catch_ptr.hpp
+++ b/include/internal/catch_ptr.hpp
@@ -20,10 +20,12 @@ namespace Catch {
public:
Ptr() : m_p( NULL ){}
Ptr( T* p ) : m_p( p ){
- m_p->addRef();
+ if( m_p )
+ m_p->addRef();
}
Ptr( const Ptr& other ) : m_p( other.m_p ){
- m_p->addRef();
+ if( m_p )
+ m_p->addRef();
}
~Ptr(){
if( m_p )
@@ -63,6 +65,9 @@ namespace Catch {
const T* operator->() const{
return m_p;
}
+ bool operator !() const {
+ return m_p == NULL;
+ }
private:
T* m_p;