diff options
Diffstat (limited to 'devel/ice/files/patch-cpp-include-IceUtil-Shared.h')
-rw-r--r-- | devel/ice/files/patch-cpp-include-IceUtil-Shared.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/devel/ice/files/patch-cpp-include-IceUtil-Shared.h b/devel/ice/files/patch-cpp-include-IceUtil-Shared.h new file mode 100644 index 000000000000..43a852a63d7e --- /dev/null +++ b/devel/ice/files/patch-cpp-include-IceUtil-Shared.h @@ -0,0 +1,72 @@ +--- cpp.orig/include/IceUtil/Shared.h 2011-06-15 21:43:58.000000000 +0200 ++++ cpp/include/IceUtil/Shared.h 2012-09-10 11:43:58.000000000 +0200 +@@ -50,6 +50,11 @@ + // + // A non thread-safe base class for reference-counted types. + // ++// IceUtil::SimpleSharedUnsafeDestructor ++// ===================== ++// ++// A non thread-safe base class for reference-counted types - destructor might throw. ++// + // IceUtil::Shared + // =============== + // +@@ -109,6 +114,57 @@ private: + bool _noDelete; + }; + ++class ICE_UTIL_API SimpleSharedUnsafeDestructor ++{ ++public: ++ ++ SimpleSharedUnsafeDestructor(); ++ SimpleSharedUnsafeDestructor(const SimpleSharedUnsafeDestructor&); ++ ++ virtual ~SimpleSharedUnsafeDestructor() ICE_NOEXCEPT_FALSE ++ { ++ } ++ ++ SimpleSharedUnsafeDestructor& operator=(const SimpleSharedUnsafeDestructor&) ++ { ++ return *this; ++ } ++ ++ void __incRef() ++ { ++ assert(_ref >= 0); ++ ++_ref; ++ } ++ ++ void __decRef() ++ { ++ assert(_ref > 0); ++ if(--_ref == 0) ++ { ++ if(!_noDelete) ++ { ++ _noDelete = true; ++ delete this; ++ } ++ } ++ } ++ ++ int __getRef() const ++ { ++ return _ref; ++ } ++ ++ void __setNoDelete(bool b) ++ { ++ _noDelete = b; ++ } ++ ++private: ++ ++ int _ref; ++ bool _noDelete; ++}; ++ + class ICE_UTIL_API Shared + { + public: |