Skip to content
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

Crash when logging off with windows key pressed twice #2205

Closed
gregorsGit opened this issue Apr 25, 2024 · 0 comments
Closed

Crash when logging off with windows key pressed twice #2205

gregorsGit opened this issue Apr 25, 2024 · 0 comments

Comments

@gregorsGit
Copy link

Hi,
i get this reproducable crash in the 3dview when i press log off with the windows short-cut
windows-Key + windows-Key (quick twice). Not Windows+L.
image

I could solve this by adding some null-checks.. im methode: DX11ImageSourceRenderer_OnNewBufferCreated

        private void DX11ImageSourceRenderer_OnNewBufferCreated(object sender, Texture2DArgs e)
        {
            try
            {
                if (surfaceD3D == null)
                {
                    logger.LogInformation("Create new D3DImageSource");
                    surfaceD3D = new DX11ImageSource(EffectsManager.AdapterIndex);
                    surfaceD3D.IsFrontBufferAvailableChanged += SurfaceD3D_IsFrontBufferAvailableChanged;
                }
                if (e.Texture != null)
                {
                    surfaceD3D.SetRenderTargetDX11(e.Texture.Resource as Texture2D);
                }
            }
            catch (Exception ex)
            {
                logger.LogError("Failed to create surfaceD3D. Ex: {0}", ex.Message);
                hasBackBuffer = false;
                if (surfaceD3D != null)
                {
                    surfaceD3D.IsFrontBufferAvailableChanged -= SurfaceD3D_IsFrontBufferAvailableChanged;
                }
                RemoveAndDispose(ref surfaceD3D);
                hasBackBuffer = false;
                EndD3D();
                ReinitializeEffectsManager();
                return;
            }
            hasBackBuffer = false;
            if (e.Texture != null)
            {
                hasBackBuffer = e.Texture.Resource is Texture2D;
            }
            OnImageSourceChanged(this, new DX11ImageSourceArgs(surfaceD3D));
            if (hasBackBuffer)
            {
                logger.LogInformation("New back buffer is set.");
            }
            else
            {
                logger.LogInformation("Set back buffer failed.");
            }
        }

Could someone change this in the source-code?

Thanks.

holance added a commit to holance/helix-toolkit that referenced this issue May 30, 2024
holance added a commit to holance/helix-toolkit that referenced this issue May 30, 2024
@holance holance closed this as completed May 30, 2024
holance added a commit that referenced this issue May 30, 2024
holance added a commit that referenced this issue May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants