Commit 82b8a7d8 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

fixed void ptr deletion

parent a3406492
...@@ -89,7 +89,34 @@ namespace campvis { ...@@ -89,7 +89,34 @@ namespace campvis {
} }
ImageRepresentationGL* toReturn = ImageRepresentationGL::create(const_cast<ImageData*>(tester->getParent()), wtp); ImageRepresentationGL* toReturn = ImageRepresentationGL::create(const_cast<ImageData*>(tester->getParent()), wtp);
delete wtp._pointer;
switch (wtp._baseType) {
case WeaklyTypedPointer::UINT8:
delete static_cast<uint8_t*>(wtp._pointer);
break;
case WeaklyTypedPointer::INT8:
delete static_cast<int8_t*>(wtp._pointer);
break;
case WeaklyTypedPointer::UINT16:
delete static_cast<uint16_t*>(wtp._pointer);
break;
case WeaklyTypedPointer::INT16:
delete static_cast<int16_t*>(wtp._pointer);
break;
case WeaklyTypedPointer::UINT32:
delete static_cast<uint32_t*>(wtp._pointer);
break;
case WeaklyTypedPointer::INT32:
delete static_cast<int32_t*>(wtp._pointer);
break;
case WeaklyTypedPointer::FLOAT:
delete static_cast<float*>(wtp._pointer);
break;
default:
tgtAssert(false, "Should not reach this - wrong base data type!");
break;
}
return toReturn; return toReturn;
} }
else if (const ImageRepresentationLocal* tester = dynamic_cast<const ImageRepresentationLocal*>(source)) { else if (const ImageRepresentationLocal* tester = dynamic_cast<const ImageRepresentationLocal*>(source)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment