Fix Cycles crash in Windows debug mode with volumes
This commit is contained in:
@@ -48,7 +48,7 @@ Attribute::Attribute(
|
|||||||
Attribute::~Attribute()
|
Attribute::~Attribute()
|
||||||
{
|
{
|
||||||
/* For voxel data, we need to free the image handle. */
|
/* For voxel data, we need to free the image handle. */
|
||||||
if (element == ATTR_ELEMENT_VOXEL) {
|
if (element == ATTR_ELEMENT_VOXEL && buffer.size()) {
|
||||||
ImageHandle &handle = data_voxel();
|
ImageHandle &handle = data_voxel();
|
||||||
handle.~ImageHandle();
|
handle.~ImageHandle();
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,11 @@ class Attribute {
|
|||||||
AttributeElement element,
|
AttributeElement element,
|
||||||
Geometry *geom,
|
Geometry *geom,
|
||||||
AttributePrimitive prim);
|
AttributePrimitive prim);
|
||||||
|
Attribute(Attribute &&other) = default;
|
||||||
|
Attribute(const Attribute &other) = delete;
|
||||||
|
Attribute &operator=(const Attribute &other) = delete;
|
||||||
~Attribute();
|
~Attribute();
|
||||||
|
|
||||||
void set(ustring name, TypeDesc type, AttributeElement element);
|
void set(ustring name, TypeDesc type, AttributeElement element);
|
||||||
void resize(Geometry *geom, AttributePrimitive prim, bool reserve_only);
|
void resize(Geometry *geom, AttributePrimitive prim, bool reserve_only);
|
||||||
void resize(size_t num_elements);
|
void resize(size_t num_elements);
|
||||||
|
@@ -119,6 +119,9 @@ void ImageHandle::clear()
|
|||||||
foreach (const int slot, tile_slots) {
|
foreach (const int slot, tile_slots) {
|
||||||
manager->remove_image_user(slot);
|
manager->remove_image_user(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tile_slots.clear();
|
||||||
|
manager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImageHandle::empty()
|
bool ImageHandle::empty()
|
||||||
|
Reference in New Issue
Block a user