| 65 | |
| 66 | |
| 67 | NpReadCheck::~NpReadCheck() |
| 68 | { |
| 69 | if (mScene) |
| 70 | { |
| 71 | // By checking if the NpScene::mConcurrentErrorCount has been incremented |
| 72 | // we can detect if an erroneous read/write was performed during |
| 73 | // this objects lifetime. In this case we also print this function's |
| 74 | // details so that the user can see which two API calls overlapped |
| 75 | if (mScene->getReadWriteErrorCount() != mErrorCount && !(mScene->getScene().getFlags() & PxSceneFlag::eREQUIRE_RW_LOCK)) |
| 76 | { |
| 77 | Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, |
| 78 | "Leaving %s on thread %d, an API overlapping write on another thread was detected.", mName, PxU32(Ps::Thread::getId())); |
| 79 | } |
| 80 | |
| 81 | mScene->stopRead(); |
| 82 | } |
| 83 | } |