fix crash in Particle Entities and pendingChanges.updateItem()

This commit is contained in:
ZappoMan 2015-07-28 14:56:38 -07:00
parent 31bce8a50e
commit c15161b71a
4 changed files with 2 additions and 6 deletions

View file

@ -3482,7 +3482,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
pendingChanges.resetItem(WorldBoxRenderData::_item, worldBoxRenderPayload);
} else {
pendingChanges.updateItem<WorldBoxRenderData>(WorldBoxRenderData::_item,
[](WorldBoxRenderData& payload) {
payload._val++;

View file

@ -93,7 +93,6 @@ void EntityTreeRenderer::clear() {
auto scene = _viewState->getMain3DScene();
render::PendingChanges pendingChanges;
foreach(auto entity, _entitiesInScene) {
entity->removeFromScene(entity, scene, pendingChanges);
}

View file

@ -174,7 +174,6 @@ uint32_t toRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
}
void RenderableParticleEffectEntityItem::updateRenderItem() {
if (!_scene) {
return;
}
@ -212,8 +211,7 @@ void RenderableParticleEffectEntityItem::updateRenderItem() {
}
render::PendingChanges pendingChanges;
pendingChanges.updateItem<ParticlePayload>(_renderItemId, [&](ParticlePayload& payload) {
pendingChanges.updateItem<ParticlePayload>(_renderItemId, [this](ParticlePayload& payload) {
// update vertex buffer
auto vertexBuffer = payload.getVertexBuffer();
size_t numBytes = sizeof(Vertex) * _vertices.size();

View file

@ -184,8 +184,8 @@ void Scene::processPendingChangesQueue() {
// Now we know for sure that we have enough items in the array to
// capture anything coming from the pendingChanges
resetItems(consolidatedPendingChanges._resetItems, consolidatedPendingChanges._resetPayloads);
removeItems(consolidatedPendingChanges._removedItems);
updateItems(consolidatedPendingChanges._updatedItems, consolidatedPendingChanges._updateFunctors);
removeItems(consolidatedPendingChanges._removedItems);
// ready to go back to rendering activities
_itemsMutex.unlock();