Commit 142ea27a authored by Xavier Thompson's avatar Xavier Thompson

Fix Forked move/destruction

parent a40f0ea8
...@@ -80,8 +80,10 @@ namespace typon ...@@ -80,8 +80,10 @@ namespace typon
{ {
if (_result) if (_result)
{ {
if (_refcount) {
_refcount->decref(); _refcount->decref();
} }
}
else else
{ {
std::destroy_at(std::addressof(_value)); std::destroy_at(std::addressof(_value));
...@@ -152,9 +154,11 @@ namespace typon ...@@ -152,9 +154,11 @@ namespace typon
{ {
if (_result) if (_result)
{ {
if (_data) {
reinterpret_cast<ForkRefcount *>(_data)->decref(); reinterpret_cast<ForkRefcount *>(_data)->decref();
} }
} }
}
T& get() T& get()
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment