From 89a4ea6470a433d6ab7b2cf71888fca1cd0469ed Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 8 Oct 2013 09:56:47 -0700 Subject: [PATCH] two possible crash fixes --- interface/src/VoxelSystem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 24ca83b8a3..c8791000c6 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -908,6 +908,10 @@ int VoxelSystem::updateNodeInArraysAsFullVBO(VoxelNode* node) { // will forcibly remove it from the VBOs because we know better!!! int VoxelSystem::forceRemoveNodeFromArraysAsPartialVBO(VoxelNode* node) { + if (!_initialized) { + return 0; + } + // if the node is not in the VBOs then we have nothing to do! if (node->isKnownBufferIndex()) { @@ -937,6 +941,10 @@ int VoxelSystem::updateNodeInArraysAsPartialVBO(VoxelNode* node) { if (_voxelsInWriteArrays >= _maxVoxels) { return 0; } + + if (!_initialized) { + return 0; + } // Now, if we've changed any attributes (our renderness, our color, etc) then update the Arrays... if (node->isDirty()) {