| 74 | |
| 75 | |
| 76 | NpWriteCheck::~NpWriteCheck() |
| 77 | { |
| 78 | if (mScene) |
| 79 | { |
| 80 | // By checking if the NpScene::mConcurrentErrorCount has been incremented |
| 81 | // we can detect if an erroneous read/write was performed during |
| 82 | // this objects lifetime. In this case we also print this function's |
| 83 | // details so that the user can see which two API calls overlapped |
| 84 | if (mScene->getReadWriteErrorCount() != mErrorCount && !(mScene->getScene().getFlags() & PxSceneFlag::eREQUIRE_RW_LOCK)) |
| 85 | { |
| 86 | Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, |
| 87 | "Leaving %s on thread %d, an overlapping API read or write by another thread was detected.", mName, PxU32(Ps::Thread::getId())); |
| 88 | } |
| 89 | |
| 90 | mScene->stopWrite(mAllowReentry); |
| 91 | } |
| 92 | } |