Skip to content

Panics when window is minimized in Windows 10 #2866

@molor824

Description

@molor824

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-WindowsSpecific to the Windows desktop operating systemP-CrashA sudden unexpected crashS-DuplicateThis issue or PR already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions