fix: fix a ImageViewer delete bug
This commit is contained in:
@@ -97,6 +97,7 @@ DICOMImageViewer::~DICOMImageViewer() {
|
|||||||
this->ImageMapper = nullptr;
|
this->ImageMapper = nullptr;
|
||||||
}
|
}
|
||||||
if (this->ImageActor) {
|
if (this->ImageActor) {
|
||||||
|
ImageStack->RemoveImage(ImageActor);
|
||||||
this->ImageActor->Delete();
|
this->ImageActor->Delete();
|
||||||
this->ImageActor = nullptr;
|
this->ImageActor = nullptr;
|
||||||
}
|
}
|
||||||
@@ -106,10 +107,15 @@ DICOMImageViewer::~DICOMImageViewer() {
|
|||||||
this->FusionMapper = nullptr;
|
this->FusionMapper = nullptr;
|
||||||
}
|
}
|
||||||
if (this->FusionActor) {
|
if (this->FusionActor) {
|
||||||
|
ImageStack->RemoveImage(FusionActor);
|
||||||
this->FusionActor->Delete();
|
this->FusionActor->Delete();
|
||||||
this->FusionActor = nullptr;
|
this->FusionActor = nullptr;
|
||||||
}
|
}
|
||||||
|
if (this->ImageStack) {
|
||||||
|
this->Renderer->RemoveActor(ImageStack);
|
||||||
|
this->ImageStack->Delete();
|
||||||
|
// this->ImageStack = nullptr;
|
||||||
|
}
|
||||||
if (this->Renderer) {
|
if (this->Renderer) {
|
||||||
this->Renderer->Delete();
|
this->Renderer->Delete();
|
||||||
this->Renderer = nullptr;
|
this->Renderer = nullptr;
|
||||||
@@ -345,7 +351,6 @@ void DICOMImageViewer::UnInstallPipeline() {
|
|||||||
void DICOMImageViewer::Render() {
|
void DICOMImageViewer::Render() {
|
||||||
if (this->FirstRender) {
|
if (this->FirstRender) {
|
||||||
// // Initialize the size if not set yet
|
// // Initialize the size if not set yet
|
||||||
|
|
||||||
vtkAlgorithm *input = this->GetInputAlgorithm();
|
vtkAlgorithm *input = this->GetInputAlgorithm();
|
||||||
if (input) {
|
if (input) {
|
||||||
input->UpdateInformation();
|
input->UpdateInformation();
|
||||||
@@ -363,6 +368,7 @@ void DICOMImageViewer::Render() {
|
|||||||
ResetZoomScaleToFitWindowSize();
|
ResetZoomScaleToFitWindowSize();
|
||||||
}
|
}
|
||||||
this->FirstRender = 0;
|
this->FirstRender = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->GetInput()) {
|
if (this->GetInput()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user