Skip to content
4 changes: 4 additions & 0 deletions livekit-rtc/livekit/rtc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
from .room import (
ConnectError,
DataPacket,
DataStreamOptions,
Room,
RoomOptions,
RtcConfiguration,
Expand Down Expand Up @@ -123,6 +124,7 @@
TextStreamWriter,
ByteStreamWriter,
ByteStreamReader,
StreamError,
)
from .data_track import (
LocalDataTrack,
Expand Down Expand Up @@ -172,6 +174,7 @@
"ConnectError",
"Room",
"RoomOptions",
"DataStreamOptions",
"RtcConfiguration",
"SimulateScenarioKind",
"SipDTMF",
Expand Down Expand Up @@ -217,6 +220,7 @@
"TextStreamWriter",
"ByteStreamReader",
"ByteStreamWriter",
"StreamError",
"AudioProcessingModule",
"PlatformAudio",
"PlatformAudioSource",
Expand Down
9 changes: 9 additions & 0 deletions livekit-rtc/livekit/rtc/_ffi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ def __del__(self) -> None:
def disposed(self) -> bool:
return self._disposed

def mark_consumed(self) -> None:
"""Marks the handle as already released on the native side.

Some requests take ownership of their handle (``take_handle``) rather
than borrowing it. After issuing one, the handle must not be dropped
again, so this suppresses the drop that dispose/GC would otherwise do.
"""
self._disposed = True

def dispose(self) -> None:
if self.handle != INVALID_HANDLE and not self._disposed:
self._disposed = True
Expand Down
Loading
Loading