diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-10-08 01:15:43 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-10-08 01:15:43 +0000 |
| commit | ce31009e697830314591ffa4760da9705fc7982a (patch) | |
| tree | 34e27947f10e0d6a5c48d6c6851bd69ec2cb83ea /lib/kernel/Generator.ml | |
| parent | 0354a7c21cae08cda07864dcb70a76d37fe43375 (diff) | |
| download | RNT-ce31009e697830314591ffa4760da9705fc7982a.tar.gz RNT-ce31009e697830314591ffa4760da9705fc7982a.zip | |
Objects with a null lifecycle should not have a destructor
Diffstat (limited to '')
| -rw-r--r-- | lib/kernel/Generator.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/kernel/Generator.ml b/lib/kernel/Generator.ml index 272bb86..b83de3b 100644 --- a/lib/kernel/Generator.ml +++ b/lib/kernel/Generator.ml @@ -12,7 +12,7 @@ let resume k = Effect.Deep.continue k () class producer_cursor produce finally = object (self) - inherit Lifecycle.null + inherit Lifecycle.counted inherit Identity.of_id method to_string = "producer-cursor" val mutable state : [`Fresh | `Live of (unit, step) Effect.Deep.continuation | `Done] = `Fresh @@ -49,7 +49,7 @@ class producer_cursor produce finally = if limit <= 0 then Ok Protocols.Cursor.{tuples= BatFingerTree.empty; exhausted= state = `Done} else fill 0 BatFingerTree.empty - method! release = match state with `Fresh | `Live _ -> self#finish | `Done -> () + method destroy = match state with `Fresh | `Live _ -> self#finish | `Done -> () end let cursor_of ?finally produce = new producer_cursor produce finally |> Protocols.Handle.make |
