When using QQuickVTKRenderItem, removing the render produces a memory leak

I recently tested the use of QtQuick(QT5.15) with VTK9.1. I checked the routines, and it can be displayed normally based on QQuickVTKRenderItem, but I am confused about how to safely clear the display of the window

When I use QVTKOpenGLNativeWidget with QWidget, I remove the render in the window, and then generate a new one for replacement. This method can be emptied normally and does not cause memory leaks.

struct WindowHandle
{
    vtkSmartPointer<vtkGenericOpenGLRenderWindow> Window = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
    vtkSmartPointer<vtkRenderWindowInteractor> RenderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    vtkSmartPointer<vtkRenderer> Renderer = vtkSmartPointer<vtkRenderer>::New();
    QVTKOpenGLNativeWidget* OpenGLNativeWidget = nullptr;
}

WindowHandle.Window->AddRenderer(WindowHandle.Renderer);

WindowHandle.OpenGLNativeWidget = Widget;
WindowHandle.OpenGLNativeWidget->setRenderWindow(WindowHandle.Window);
WindowHandle.RenderWindowInteractor = WindowHandle.OpenGLNativeWidget->renderWindow()->GetInteractor();


WindowHandle.Window->RemoveRenderer(WindowHandle.Renderer);
WindowHandle.Renderer = vtkSmartPointer<vtkRenderer>::New();
WindowHandle.Window->AddRenderer(WindowHandle.Renderer);
WindowHandle.Window->Render();

But when working with QtQuick, the same code is used, but there is a memory leak. I don’t know if there is a problem with my operation, or does QtQuick need a different cleanup code?

struct WindowHandle
{
    vtkSmartPointer<vtkGenericOpenGLRenderWindow> Window = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
    vtkSmartPointer<vtkRenderWindowInteractor> RenderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    vtkSmartPointer<vtkRenderer> Renderer = vtkSmartPointer<vtkRenderer>::New();
    QQuickVTKRenderItem* QQuickVTKItem = nullptr;
}

WindowHandle.Window->AddRenderer(WindowHandle.Renderer);

WindowHandle.QQuickVTKItem = QQuickVTKItem;
WindowHandle.QQuickVTKItem->renderWindow()->setRenderWindow(WindowHandle.Window);
WindowHandle.RenderWindowInteractor = WindowHandle.QQuickVTKItem->renderWindow()->renderWindow()->GetInteractor();


WindowHandle.Window->RemoveRenderer(WindowHandle.Renderer);
WindowHandle.Renderer = vtkSmartPointer<vtkRenderer>::New();
WindowHandle.Window->AddRenderer(WindowHandle.Renderer);
WindowHandle.Window->Render();