-
-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HelixToolkit.UWP.Viewport3DX has memory leaks #1185
Comments
Could you upload a simple demo for this issue? |
Are you creating new viewport frequently? After you detach it from the visual tree, you need to manually set its EffectsManager to null (If using binding, set its DataContext to null). Otherwise resources will not be released. |
Hi holance, Sorry for the late reply... I tried your suggestion above, but it does not seem to release properly all the resources used by the viewport3DX. I've made a sample app, which purpose is just to attach and detach a Viewport3DX object. The Viewport3DX detached is never collected by the garbage collector (collector can be called using CTRL+G keys). I guess i'm not doing things correctly when detaching the Viewport3DX object... Maybe you can have a quick look at the sample app? Thanks a lot, |
Let me know if you are still getting leaks. |
Hi holance, Thanks for your reply! I've tried my sample app with the develop branch of the helix toolkit repo, where your patch has been merged. When I attach / dettach a viewport3DX, the object is not collected by the garbage collector (see the screenshot belown, 3 viewport3DX were created, none of them was removed by the GC I do the following to remove my Viewport3DX object:
Am i missing something here? The EffectsManager is not disposed when removing a Viewport3DX. All Viewport3DX objects created share the same EffectManager. The EffectManager is disposed when the user navigates to another Page. Thanks for your help! |
I am using following:
|
Hi holance, Using your code, it works 👍 Do you plan to include your fix to a 2.18.1 version? Thanks! |
Hi holance, Any chance that you provide a new release with the hotfix for the Viewport3DX leaks soon? Thanks, |
Probably early October. |
Hi,
In my app, i'm a using a
UserControl
which includes aViewport3DX
. ThisUserControl
is attached to the xaml tree and detached from the xaml tree when the user opens it or close it. I'm using a singleEffectManager
which is shared by all theViewport3DX
instances.I suspect the
Viewport3DX
control does not correctly free all its resources when it is detached. For example, binding toItems.CollectionChanged
is never unbound when the view is detached. The properties for which a callback are registered are not unregistered. I am using Assimp to import my models. SomeMemoryStreams
(TextureModel
) used by theViewport3DX
(ViewCubeMaterialCore
,BillboardText3D
) are not disposed once the view is detached.Can you have a look? Thanks!
The text was updated successfully, but these errors were encountered: