Commit ca5bdaf
committed
Fix PhysicsManager.clear_callbacks ID-recycle bug
clear_callbacks() reset _callback_id back to 0, so subsequent
register_callback() calls handed out IDs that collided with old
CallbackHandle.id values still held by not-yet-garbage-collected
sensors / assets. When the old object's __del__ eventually ran it
deregistered the NEW callback by ID — leaving the new sensor's
_initialize_callback wired up but never fired.
The symptom under kitless OVPhysX was a sensor that registered its
callback, then PHYSICS_READY dispatched, then sensor.reset()
crashed with 'has no attribute _ALL_ENV_MASK' (init never ran).
The PhysX backend hid this because its callback registry is the
Carbonite event bus rather than this Python dict.
Keep _callback_id monotonic across clear_callbacks invocations to
preserve uniqueness for the lifetime of the process.1 parent 38e076b commit ca5bdaf
2 files changed
Lines changed: 27 additions & 8 deletions
File tree
- source
- isaaclab_ovphysx/isaaclab_ovphysx/sensors/contact_sensor
- isaaclab/isaaclab/physics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
160 | 173 | | |
161 | 174 | | |
162 | 175 | | |
163 | | - | |
164 | 176 | | |
165 | 177 | | |
166 | 178 | | |
| |||
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
| |||
0 commit comments