From 76744991dfde1332e2d16533d88089066081839f Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Fri, 17 Apr 2026 11:21:37 +0100 Subject: [PATCH] Add some warnings on channels.release() --- specifications/api-docstrings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specifications/api-docstrings.md b/specifications/api-docstrings.md index ff9bd0894..f0d9594b1 100644 --- a/specifications/api-docstrings.md +++ b/specifications/api-docstrings.md @@ -255,7 +255,7 @@ Creates and destroys [`RestChannel`]{@link RestChannel} and [`RealtimeChannel`]{ ||| `ChannelType` || A [`RealtimeChannel`]{@link RealtimeChannel} object. | | iterate() -> `Iterator` ||| RSN2, RTS2 | Iterates through the existing channels. | ||| `ChannelType` || Each iteration returns a [`RestChannel`]{@link RestChannel} or [`RealtimeChannel`]{@link RealtimeChannel} object. | -| release(String) ||| RSN4, RTS4 | Releases a [`RestChannel`]{@link RestChannel} or [`RealtimeChannel`]{@link RealtimeChannel} object, deleting it, and enabling it to be garbage collected. It also removes any listeners associated with the channel. To release a channel, the [`ChannelState`]{@link ChannelState} must be `INITIALIZED`, `DETACHED`, or `FAILED`. | +| release(String) ||| RSN4, RTS4 | Releases all SDK-held references to a [`RestChannel`]{@link RestChannel} or [`RealtimeChannel`]{@link RealtimeChannel} object, enabling it to be garbage collected. Warning: this method has no guardrails; using a channel reference after it has been `release()`d is undefined behaviour. It can be useful for applications that work with a continually changing set of channels on a single client and need to avoid unbounded memory growth; if this does not describe you, don't call it. Realtime channels not already in the `INITIALIZED`, `DETACHED`, or `FAILED` state are detached before release. | || `String` ||| The channel name. | ## class RestChannel