From: Keith F. <ven...@us...> - 2002-11-11 04:10:12
|
Update of /cvsroot/planeshift/planeshift/src/common/psprop/imp In directory usw-pr-cvs1:/tmp/cvs-serv5904 Modified Files: pslinmove.h pslinmove.cpp Log Message: Took out csRef to mesh PC, which I think was causing a circular refcount issue. Index: pslinmove.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psprop/imp/pslinmove.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pslinmove.h 16 Sep 2002 22:51:34 -0000 1.18 --- pslinmove.h 11 Nov 2002 04:10:05 -0000 1.19 *************** *** 66,70 **** { protected: ! csRef<iPcMesh> pcmesh; csRef<iCollideSystem> cdsys; csRef<iEngine> engine; --- 66,70 ---- { protected: ! iPcMesh * pcmesh; csRef<iCollideSystem> cdsys; csRef<iEngine> engine; Index: pslinmove.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psprop/imp/pslinmove.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** pslinmove.cpp 9 Nov 2002 04:42:34 -0000 1.43 --- pslinmove.cpp 11 Nov 2002 04:10:06 -0000 1.44 *************** *** 424,433 **** if (!pcmesh) { ! pcmesh = CEL_QUERY_PROPCLASS( entity->GetPropertyClassList(), iPcMesh ); ! if (!pcmesh) { printf("No Mesh found on entity!\n"); return false; } lastKnownPosition = pcmesh->GetMesh()->GetMovable()->GetPosition(); csReversibleTransform rt = pcmesh->GetMesh()->GetMovable()->GetFullTransform(); --- 424,436 ---- if (!pcmesh) { ! csRef<iPcMesh> pcmeshref; ! pcmeshref = CEL_QUERY_PROPCLASS( entity->GetPropertyClassList(), iPcMesh ); ! if (!pcmeshref) { printf("No Mesh found on entity!\n"); return false; } + pcmesh = pcmeshref; // Get out of csRef refcounting and just save ptr + lastKnownPosition = pcmesh->GetMesh()->GetMovable()->GetPosition(); csReversibleTransform rt = pcmesh->GetMesh()->GetMovable()->GetFullTransform(); *************** *** 474,480 **** if (!pcmesh) { ! pcmesh = CEL_QUERY_PROPCLASS( entity->GetPropertyClassList(), iPcMesh ); ! if (!pcmesh) { printf("No Mesh found on entity!\n"); --- 477,484 ---- if (!pcmesh) { ! csRef<iPcMesh> pcmeshref; ! pcmeshref = CEL_QUERY_PROPCLASS( entity->GetPropertyClassList(), iPcMesh ); ! if (!pcmeshref) { printf("No Mesh found on entity!\n"); *************** *** 483,486 **** --- 487,491 ---- else { + pcmesh = pcmeshref; // Pull ptr out of csRef lastKnownPosition = pcmesh->GetMesh()->GetMovable()->GetPosition(); csReversibleTransform rt = pcmesh->GetMesh()->GetMovable()->GetFullTransform(); |