andy-thomason / Vookoo

A set of utilities for taking the pain out of Vulkan in header only modern C++
MIT License
522 stars 52 forks source link

Fix surface destruction in framework #4

Closed TinyTinni closed 6 years ago

TinyTinni commented 6 years ago

Hi, I have another PR.

UniqueSurface in the window class uses a SurfaceDeleter with a default parameter for the instance. The default paramater for the instance is NULL. Given this, SurfaceDeleter destroys the given surface handle with a NULL interface Handle. Therefore, the surface is not correctly destroyed e.g. in the window destructor, which can lead to a memory leak or an exception/program crash (e.g. msvc debug mode).