fix: fix a memory leak bug, in measure for text actor
This commit is contained in:
@@ -142,6 +142,10 @@ EllipseAnnotationActor::~EllipseAnnotationActor() {
|
|||||||
controlP_rt = nullptr;
|
controlP_rt = nullptr;
|
||||||
controlP_lb = nullptr;
|
controlP_lb = nullptr;
|
||||||
controlP_rb = nullptr;
|
controlP_rb = nullptr;
|
||||||
|
if (text) {
|
||||||
|
text->Delete();
|
||||||
|
text = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EllipseAnnotationActor::SetRenderer(vtkRenderer *ren) {
|
void EllipseAnnotationActor::SetRenderer(vtkRenderer *ren) {
|
||||||
|
|||||||
@@ -140,6 +140,11 @@ OpenPolyAnnotationActor::~OpenPolyAnnotationActor() {
|
|||||||
p->Delete();
|
p->Delete();
|
||||||
});
|
});
|
||||||
controlPointList.clear();
|
controlPointList.clear();
|
||||||
|
if (text)
|
||||||
|
{
|
||||||
|
text->Delete();
|
||||||
|
text=nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenPolyAnnotationActor::selfDragCb(vtkObject *, unsigned long event, void *data) {
|
void OpenPolyAnnotationActor::selfDragCb(vtkObject *, unsigned long event, void *data) {
|
||||||
|
|||||||
@@ -153,6 +153,10 @@ RoundAnnotationActor::~RoundAnnotationActor() {
|
|||||||
controlP_rt = nullptr;
|
controlP_rt = nullptr;
|
||||||
controlP_lb = nullptr;
|
controlP_lb = nullptr;
|
||||||
controlP_rb = nullptr;
|
controlP_rb = nullptr;
|
||||||
|
if (text) {
|
||||||
|
text->Delete();
|
||||||
|
text = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundAnnotationActor::SetRenderer(vtkRenderer *ren) {
|
void RoundAnnotationActor::SetRenderer(vtkRenderer *ren) {
|
||||||
|
|||||||
Reference in New Issue
Block a user