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

Panics when window is minimized in Windows 10 #2866

Closed
molor824 opened this issue Sep 25, 2021 · 4 comments
Closed

Panics when window is minimized in Windows 10 #2866

molor824 opened this issue Sep 25, 2021 · 4 comments
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Windows Specific to the Windows desktop operating system P-Crash A sudden unexpected crash S-Duplicate This issue or PR already exists

Comments

@molor824
Copy link

molor824 commented Sep 25, 2021

Bevy version

v0.5.0

Operating system & version

Windows 10

What you did

Tried to minimize window

What you expected to happen

Minimizes window

What actually happened

Paniced

thread 'main' panicked at 'Handling wgpu errors as fatal by default'
Sep 25 20:06:36.098 ERROR gpu_descriptor::allocator: `DescriptorAllocator` is dropped while some descriptor sets were not deallocated
Sep 25 20:06:36.133 ERROR gpu_alloc::block: Memory block wasn't deallocated
...

Additional information

In wgpu getting started docs, function for resizing/minimizing was using if statement to check if new window size is 0 or not

    pub fn resize(&mut self, new_size: PhysicalSize<u32>) {
        if new_size.width > 0 && new_size.height > 0 {
            self.size = new_size;
            self.surface_config.width = new_size.width;
            self.surface_config.height = new_size.height;

            self.surface.configure(&self.device, &self.surface_config);
        }
    }

removing the if statement resulted in

thread 'main' panicked at 'Error in Surface::configure: Both `Surface` width and height must be non-zero. Wait to recreate the `Surface` until the window has non-zero area.
@molor824 molor824 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 25, 2021
@DJMcNab
Copy link
Member

DJMcNab commented Sep 25, 2021

Possible duplicate of #899, #2018, #170, #1882.

Can you confirm whether this crash still occurs on the current main branch?

@molor824
Copy link
Author

Possible duplicate of #899, #2018, #170, #1882.

Can you confirm whether this crash still occurs on the current main branch?

im not sure, im using latest version from crates.io

@NiklasEi NiklasEi added A-Windowing Platform-agnostic interface layer to run your app in P-Crash A sudden unexpected crash and removed S-Needs-Triage This issue needs to be labelled labels Sep 25, 2021
@DJMcNab
Copy link
Member

DJMcNab commented Sep 25, 2021

The easiest way to test this out with bevy main (currently at d158e08) would be to clone the repository and run any example.

@molor824
Copy link
Author

The easiest way to test this out with bevy main (currently at d158e08) would be to clone the repository and run any example.

ah i see, the latest main branch has fixed it, im closing the issue now

@NiklasEi NiklasEi added O-Windows Specific to the Windows desktop operating system S-Duplicate This issue or PR already exists labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Windows Specific to the Windows desktop operating system P-Crash A sudden unexpected crash S-Duplicate This issue or PR already exists
Projects
None yet
Development

No branches or pull requests

3 participants