diff options
author | David Robillard <d@drobilla.net> | 2020-08-01 23:39:12 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-02 01:48:48 +0200 |
commit | 1d6abdf72ccce7964ccb6b7b5bbcd3d469a2b54c (patch) | |
tree | a7d0afb218abc03509a5f686f19fe7378b5728cb /src/server | |
parent | c9a4811dac7c61bf115eae2f10085db65c984fb0 (diff) | |
download | ingen-1d6abdf72ccce7964ccb6b7b5bbcd3d469a2b54c.tar.gz ingen-1d6abdf72ccce7964ccb6b7b5bbcd3d469a2b54c.tar.bz2 ingen-1d6abdf72ccce7964ccb6b7b5bbcd3d469a2b54c.zip |
Fix self-assignment
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/UndoStack.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/UndoStack.hpp b/src/server/UndoStack.hpp index 26334aeb..22d48379 100644 --- a/src/server/UndoStack.hpp +++ b/src/server/UndoStack.hpp @@ -54,10 +54,12 @@ public: ~Entry() { clear(); } Entry& operator=(const Entry& rhs) { - clear(); - time = rhs.time; - for (const LV2_Atom* ev : rhs.events) { - push_event(ev); + if (&rhs != this) { + clear(); + time = rhs.time; + for (const LV2_Atom* ev : rhs.events) { + push_event(ev); + } } return *this; } |