History

Fix for metavoxel crashes on Windows. I was expecting the scope of a temporary object to last until the next line; turns out VC++ can destroy it in the middle of evaluating the line.

Andrzej Kapolka committed 12 years ago

Commit 72ff9081 parent 9855fbc1 file · +10 −5Browse files

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

Unified · Split

interface/src/MetavoxelSystem.cpp+10−5
@@ -1204,7 +1204,8 @@ int PointAugmentVisitor::visit(MetavoxelInfo& info) { · 1203 unmodified lines
1204 _points.swap(swapPoints);1204 _points.swap(swapPoints);
1205 buffer = new PointBuffer(swapPoints);1205 buffer = new PointBuffer(swapPoints);
1206 }1206 }
1207 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(BufferDataPointer(buffer)));1207 BufferDataPointer pointer(buffer);
1208 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer));
1208 }1209 }
1209 return STOP_RECURSION;1210 return STOP_RECURSION;
1210}1211}
@@ -1219,7 +1220,8 @@ bool PointAugmentVisitor::postVisit(MetavoxelInfo& info) { · 8 unmodified lines
1219 _points.swap(swapPoints);1220 _points.swap(swapPoints);
1220 buffer = new PointBuffer(swapPoints);1221 buffer = new PointBuffer(swapPoints);
1221 }1222 }
1222 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(BufferDataPointer(buffer)));1223 BufferDataPointer pointer(buffer);
1224 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer));
1223 return true;1225 return true;
1224}1226}
1225 1227
@@ -1446,7 +1448,8 @@ int HeightfieldRegionVisitor::visit(MetavoxelInfo& info) { · 220 unmodified lines
1446 _data->guide(_fetchVisitor);1448 _data->guide(_fetchVisitor);
1447 }1449 }
1448 }1450 }
1449 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(BufferDataPointer(buffer)));1451 BufferDataPointer pointer(buffer);
1452 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer));
1450 return STOP_RECURSION;1453 return STOP_RECURSION;
1451}1454}
1452 1455
@@ -1505,7 +1508,8 @@ int HeightfieldUpdateVisitor::visit(MetavoxelInfo& info) { · 52 unmodified lines
1505 buffer->getHeight(), buffer->getColor(), buffer->getMaterial(), buffer->getMaterials());1508 buffer->getHeight(), buffer->getColor(), buffer->getMaterial(), buffer->getMaterials());
1506 _fetchVisitor.init(newBuffer);1509 _fetchVisitor.init(newBuffer);
1507 _data->guide(_fetchVisitor);1510 _data->guide(_fetchVisitor);
1508 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(BufferDataPointer(newBuffer)));1511 BufferDataPointer pointer(newBuffer);
1512 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer));
1509 return STOP_RECURSION;1513 return STOP_RECURSION;
1510}1514}
1511 1515
@@ -2078,7 +2082,8 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 566 unmodified lines
2078 2082
2079 buffer = new VoxelBuffer(vertices, indices, material->getMaterials());2083 buffer = new VoxelBuffer(vertices, indices, material->getMaterials());
2080 }2084 }
2081 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(BufferDataPointer(buffer)));2085 BufferDataPointer pointer(buffer);
2086 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer));
2082 return STOP_RECURSION;2087 return STOP_RECURSION;
2083}2088}
2084 2089