about summary refs log tree commit diff
path: root/pkg/lang/vm/value/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/vm/value/value.go')
-rw-r--r--pkg/lang/vm/value/value.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/lang/vm/value/value.go b/pkg/lang/vm/value/value.go
index 953ac8b..5dd5012 100644
--- a/pkg/lang/vm/value/value.go
+++ b/pkg/lang/vm/value/value.go
@@ -155,6 +155,11 @@ func (v Value) Clone(m mem.Mem) Value {
 		m.Retain(fn.env)
 	}
 
+	// If value has an outlet don't copy it into the clone,
+	// otherwise when the clone is dropped it will also drop the outlet.
+	// I don't know if this fixes the entire problem, but it seems to work.
+	v.outlet = mem.NullPtr
+
 	return v
 }