Don't forget to destroy the previous value when assigning a new one

This commit is contained in:
Olivier Goffart 2021-03-17 16:33:22 +01:00
parent f09ea8bf6f
commit d5823f2b42

View file

@ -30,6 +30,9 @@ public:
} }
Value &operator=(Value &&other) Value &operator=(Value &&other)
{ {
if (this == &other)
return *this;
cbindgen_private::sixtyfps_interpreter_value_destructor(&inner);
inner = other.inner; inner = other.inner;
cbindgen_private::sixtyfps_interpreter_value_new(&other.inner); cbindgen_private::sixtyfps_interpreter_value_new(&other.inner);
return *this; return *this;