include/xot/pimpl.h in xot-0.1.22 vs include/xot/pimpl.h in xot-0.1.23

- old
+ new

@@ -23,15 +23,20 @@ PImpl () : Super(new T) {} PImpl (T* p) : Super(p) {} - PImpl (const This& obj) : Super(new T(*obj)) {} + PImpl (const This& obj) + : Super(obj ? new T(*obj) : NULL) + { + } This& operator = (const This& obj) { - if (&obj != this) reset(new T(*obj)); + if (&obj == this) return *this; + + this->reset(obj ? new T(*obj) : NULL); return *this; } };// PImpl @@ -40,10 +45,10 @@ class PSharedImpl : public std::shared_ptr<T> { typedef std::shared_ptr<T> Super; - typedef PImpl<T> This; + typedef PSharedImpl<T> This; public: PSharedImpl () : Super(new T) {}