Fix a memory leak when copy.deepcopy(data) is called.

In MjDataWrapper.__deepcopy__ use the Python implementation of MjModelWrapper.__deepcopy__ to make an object that Python knows about and can release later.

Fixes google-deepmind/mujoco#1572.

PiperOrigin-RevId: 644967999
Change-Id: I95d093c672e136122e1939f69463a4d29dad82e8
This commit is contained in:
Nimrod Gileadi
2024-06-20 03:45:26 -07:00
committed by Copybara-Service
parent 3f3b39bbb1
commit 2188cba4cd
3 changed files with 78 additions and 3 deletions
+4
View File
@@ -50,6 +50,10 @@ Simulate
|br| |br| |br| |br|
Python bindings
^^^^^^^^^^^^^^^
13. Fixed a memory leak when using ``copy.deepcopy()`` on a ``mujoco.MjData`` instance (:github:issue:`1572`).
Version 3.1.6 (Jun 3, 2024)
---------------------------