Browse Source

Fixed bug with releasing PhysxController (get_actor got called after unlink).

enn0x 15 năm trước cách đây
mục cha
commit
39ffe108c3
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      panda/src/physx/physxController.cxx

+ 2 - 1
panda/src/physx/physxController.cxx

@@ -34,8 +34,9 @@ release() {
 
   nassertv(_error_type == ET_ok);
 
+  NxControllerManager *cm = get_actor()->get_scene()->cm();
   unlink();
-  get_actor()->get_scene()->cm()->releaseController(*ptr());
+  cm->releaseController(*ptr());
 }
 
 ////////////////////////////////////////////////////////////////////