Commit d848400a authored by Carson Brownlee's avatar Carson Brownlee Committed by Carson Brownlee
Browse files

removing ospRelease conditionals

parent e3a95d36
...@@ -51,7 +51,7 @@ vtkOSPRayLightNode::~vtkOSPRayLightNode() ...@@ -51,7 +51,7 @@ vtkOSPRayLightNode::~vtkOSPRayLightNode()
if (orn) if (orn)
{ {
RTW::Backend* backend = orn->GetBackend(); RTW::Backend* backend = orn->GetBackend();
if (backend != nullptr && this->OLight) if (backend != nullptr)
ospRelease((OSPLight)this->OLight); ospRelease((OSPLight)this->OLight);
} }
} }
...@@ -153,8 +153,6 @@ void vtkOSPRayLightNode::Render(bool prepass) ...@@ -153,8 +153,6 @@ void vtkOSPRayLightNode::Render(bool prepass)
RTW::Backend* backend = orn->GetBackend(); RTW::Backend* backend = orn->GetBackend();
if (backend == nullptr) if (backend == nullptr)
return; return;
// if (this->OLight);
// ospRelease(this->OLight);
OSPLight ospLight; OSPLight ospLight;
vtkLight* light = vtkLight::SafeDownCast(this->GetRenderable()); vtkLight* light = vtkLight::SafeDownCast(this->GetRenderable());
......
...@@ -451,18 +451,12 @@ vtkOSPRayRendererNode::~vtkOSPRayRendererNode() ...@@ -451,18 +451,12 @@ vtkOSPRayRendererNode::~vtkOSPRayRendererNode()
if (this->Internal->Backend != nullptr) if (this->Internal->Backend != nullptr)
{ {
RTW::Backend* backend = this->Internal->Backend; RTW::Backend* backend = this->Internal->Backend;
if (this->ODummyInstanceData) ospRelease(this->ODummyInstanceData);
ospRelease(this->ODummyInstanceData); ospRelease(this->OWorld);
if (this->OWorld) ospRelease(this->ORenderer);
ospRelease(this->OWorld); ospRelease(this->OFrameBuffer);
if (this->ORenderer) ospRelease(this->OLightArray);
ospRelease(this->ORenderer); ospRelease(this->OCamera);
if (this->OFrameBuffer)
ospRelease(this->OFrameBuffer);
if (this->OLightArray)
ospRelease(this->OLightArray);
if (this->OCamera)
ospRelease(this->OCamera);
} }
this->AccumulateMatrix->Delete(); this->AccumulateMatrix->Delete();
delete this->Internal; delete this->Internal;
...@@ -1280,8 +1274,7 @@ void vtkOSPRayRendererNode::Render(bool prepass) ...@@ -1280,8 +1274,7 @@ void vtkOSPRayRendererNode::Render(bool prepass)
this->ImageX = this->Size[0]; this->ImageX = this->Size[0];
this->ImageY = this->Size[1]; this->ImageY = this->Size[1];
const size_t size = this->ImageX * this->ImageY; const size_t size = this->ImageX * this->ImageY;
if (this->OFrameBuffer) ospRelease(this->OFrameBuffer);
ospRelease(this->OFrameBuffer);
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wextra" #pragma GCC diagnostic ignored "-Wextra"
this->OFrameBuffer = ospNewFrameBuffer(isize, this->OFrameBuffer = ospNewFrameBuffer(isize,
...@@ -1521,11 +1514,8 @@ void vtkOSPRayRendererNode::Render(bool prepass) ...@@ -1521,11 +1514,8 @@ void vtkOSPRayRendererNode::Render(bool prepass)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
// release data used to store instances and clear world // release data used to store instances and clear world
if (this->OInstanceData) ospRelease(this->OInstanceData);
{ this->OInstanceData = nullptr;
ospRelease(this->OInstanceData);
this->OInstanceData = nullptr;
}
ospRelease(this->OWorld); ospRelease(this->OWorld);
this->OWorld = nullptr; this->OWorld = nullptr;
......
Supports Markdown
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