MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / free

Method free

dm_control/mujoco/wrapper/core.py:618–635  ·  view source on GitHub ↗

Frees the native resources held by this MjrContext. This is an advanced feature for use when manual memory management is necessary. This MjrContext object MUST NOT be used after this function has been called.

(self)

Source from the content-addressed store, hash-verified

616 return self._ptr()
617
618 def free(self):
619 """Frees the native resources held by this MjrContext.
620
621 This is an advanced feature for use when manual memory management is
622 necessary. This MjrContext object MUST NOT be used after this function has
623 been called.
624 """
625 if self._gl_context and not self._gl_context.terminated:
626 ptr = self.ptr
627 if ptr:
628 self._gl_context.dont_keep_alive(ptr)
629 with self._gl_context.make_current() as ctx:
630 ctx.call(ptr.free)
631
632 if self._gl_context:
633 self._gl_context.decrement_refcount()
634 self._gl_context.free()
635 self._gl_context = None
636
637 def __del__(self):
638 self.free()

Callers 1

__del__Method · 0.95

Calls 5

dont_keep_aliveMethod · 0.80
make_currentMethod · 0.80
decrement_refcountMethod · 0.80
callMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected