History

two possible crash fixes

ZappoMan committed 13 years ago

Commit 89a4ea61 parent aa80ec31 file · +8 −0Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/VoxelSystem.cpp+8−0
@@ -908,6 +908,10 @@ int VoxelSystem::updateNodeInArraysAsFullVBO(VoxelNode* node) { · 907 unmodified lines
908908 // will forcibly remove it from the VBOs because we know better!!!
909909 int VoxelSystem::forceRemoveNodeFromArraysAsPartialVBO(VoxelNode* node) {
910910
911+ if (!_initialized) {
912+ return 0;
913+ }
914+
911915 // if the node is not in the VBOs then we have nothing to do!
912916 if (node->isKnownBufferIndex()) {
913917
@@ -937,6 +941,10 @@ int VoxelSystem::updateNodeInArraysAsPartialVBO(VoxelNode* node) { · 23 unmodified lines
937941 if (_voxelsInWriteArrays >= _maxVoxels) {
938942 return 0;
939943 }
944+
945+ if (!_initialized) {
946+ return 0;
947+ }
940948
941949 // Now, if we've changed any attributes (our renderness, our color, etc) then update the Arrays...
942950 if (node->isDirty()) {