diff options
author | sbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2014-02-12 18:41:29 +0000 |
---|---|---|
committer | sbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2014-02-12 18:41:29 +0000 |
commit | 658d2f98437815782691571f373b42321ffc9226 (patch) | |
tree | 54a9b146e5738b983cb53facc09f79342aa6eba0 | |
parent | 37892a251f18c5087dc6dc930ba5060aab7142c3 (diff) |
Fix for #1521
git-svn-id: http://svn.cactuscode.org/flesh/trunk@5082 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/piraha/smart_ptr.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/piraha/smart_ptr.hpp b/src/piraha/smart_ptr.hpp index 1d9dcf6f..71e3b4d6 100644 --- a/src/piraha/smart_ptr.hpp +++ b/src/piraha/smart_ptr.hpp @@ -135,6 +135,8 @@ class smart_ptr { } void operator=(const smart_ptr<T>& s) { assert(this != NULL); + if(guts == s.guts) + return; clean(); guts = s.guts; if(guts != NULL) @@ -162,7 +164,7 @@ class smart_ptr { bool valid() const { return guts != NULL && guts->ptr != NULL; } - int ref_count() { + int ref_count() const { assert(guts != NULL); return guts->ref_count_(); } |