fix: fix a measure terminate caused crash bug

This commit is contained in:
kradchen
2025-07-07 10:15:12 +08:00
parent d726b54ce9
commit 6ea11c8834
2 changed files with 2 additions and 0 deletions

View File

@@ -354,6 +354,7 @@ void ActorDraggableInteractorStyle::UnActiveMeasure() {
if (this->measure) {
this->measure->onTerminate(this->Interactor);
this->measure->ForceDelete();
this->measure = nullptr;
}
this->EndMeasure();
this->measure = nullptr;

View File

@@ -1153,6 +1153,7 @@ void DICOMImageViewer::ClearCurrentSliceMeasure() const {
}
void DICOMImageViewer::AddMeasures(vtkObject *, unsigned long eventid, void *calldata) {
if (!calldata) return ;
auto m = static_cast<Measure *>(calldata);
if (m->Valid()) {
measureStore->Store(SERIES_UID, this->SliceIJK, this->ImageMapper->GetSliceNumber(), m);