mrvux / dx11-vvvv

DirectX11 Rendering within vvvv
Other
72 stars 71 forks source link

possible Memory Leaks #331

Closed sebllll closed 6 years ago

sebllll commented 6 years ago

Hello Mr. Vux, I think we discovered 2 memory leaks:

  1. Temptarget Dispose (forum post)

This particular issue can be prevented when adding this.FOutBuffers.SafeDisposeAll(); this.FOutAABuffers.SafeDisposeAll(); here

I'm still not sure if that's the best solution, because there might be a particular reason for the missing dispose functionality...

  1. TextureFx Dispose (forum post)

This might be a texturefx disposing issue, but a first debugging session was not successfull and i didn't find out, where the leak exactly happens.

thanks, sebl

mrvux commented 6 years ago
  1. Indeed, dispose was not called, which was a non issue normally (as the pool gets clears on app quit), but indeed that was an issue in case of create node. Dispose actually funnily fixes the issue, as it leaves a disposed locked resource in the pool, but did it the clean way as to remove it properly from there.

  2. Issue was more subtle, as actually was in the effect factory, which was not calling dispose at the end.

Both are fixed now

mrvux commented 6 years ago

Also if needed : https://ci.appveyor.com/project/mrvux/dx11-vvvv/build/1.1.1.5-alpha/artifacts

there are builds for it.

Considering there's now 3 issues worth doing new release (nil quad recovery too) I'll likely do a new version soon

sebllll commented 6 years ago

super! thanks for the quick fix and also for the explanations!

sebllll commented 6 years ago

sorry, one more related thing: the fix you applied in the shaderfactory also has to be done in the AbstractDX11CompShaderFactory for compiled effects...

i tried the exact same thing and it worked here:

        protected override bool DeleteNode(INodeInfo nodeInfo, IInternalPluginHost pluginHost)
        {
            var plugin = pluginHost.Plugin;

            if (plugin is IDisposable)
            {
                var disposablePlugin = plugin as IDisposable;
                disposablePlugin.Dispose();
            }

            if (this.PluginDeleted != null)
            {
                this.PluginDeleted(pluginHost.Plugin);
            }

            return true;
        }
mrvux commented 6 years ago

Good point, reopening

mrvux commented 6 years ago

Added on precompiled ones too, guess can close again now.