Hello,
I’ve noticed the following memory leak when using the DLSS plugin. I would be getting crashes on editor shutdown after opening a material editor, the plugin checks if any DLSS features are still in use.
Some DLSS features are still being held via the ITemporalUpscaler::IHistory object in the material editor viewport’s FSceneViewState
The reason the FSceneViewState sticks around is that there is a circular reference between SMaterialEditor3DPreviewViewport and SMaterialEditorViewportToolBar.
SMaterialEditor3DPreviewViewport holds onto SMaterialEditorViewportToolBar as it’s a child widget of the viewport.
SMaterialEditorViewportToolBar holds onto the viewport via the MaterialEditorViewportPtr SharedPtr.
Turning MaterialEditorViewportPtr into a TWeakPtr seems to fix the issue. I’ve not noticed any problems when doing this.
Regards,
Benjamin