diff --git a/src/EventHandler.h b/src/EventHandler.h index 5f8472b2ce..775fd90408 100644 --- a/src/EventHandler.h +++ b/src/EventHandler.h @@ -104,6 +104,8 @@ public: return *this; } const EventHandlerPtr& operator=(const EventHandlerPtr& h) { + if ( this == &h ) + return *this; handler = h.handler; return *this; } diff --git a/src/UID.h b/src/UID.h index aeccc03684..a951432ebe 100644 --- a/src/UID.h +++ b/src/UID.h @@ -85,6 +85,9 @@ inline UID::UID(const UID& other) { } inline UID& UID::operator=(const UID& other) { + if ( this == &other ) + return *this; + memmove(uid, other.uid, sizeof(uid)); initialized = other.initialized; return *this;