MCPcopy Index your code
hub / github.com/microsoft/playwright-python / _dispose

Method _dispose

playwright/_impl/_connection.py:177–187  ·  view source on GitHub ↗
(self, reason: Optional[str])

Source from the content-addressed store, hash-verified

175 self._event_to_subscription_mapping: Dict[str, str] = {}
176
177 def _dispose(self, reason: Optional[str]) -> None:
178 # Clean up from parent and connection.
179 if self._parent:
180 del self._parent._objects[self._guid]
181 del self._connection._objects[self._guid]
182 self._was_collected = reason == "gc"
183
184 # Dispose all children.
185 for object in list(self._objects.values()):
186 object._dispose(reason)
187 self._objects.clear()
188
189 def _adopt(self, child: "ChannelOwner") -> None:
190 del cast("ChannelOwner", child._parent)._objects[child._guid]

Callers 1

dispatchMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected