From 01a49422a7d73e45119be4a450c40c63d2818191 Mon Sep 17 00:00:00 2001 From: Squareys Date: Mon, 10 Oct 2016 01:01:01 +0200 Subject: [PATCH] Do not try to destroy state if _version was Version::None Since may not be initialized (for Vulkan). Signed-off-by: Squareys --- src/Magnum/Context.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index c1294da14..af72ead6f 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -468,7 +468,10 @@ Context::Context(Context&& other): _version{std::move(other._version)}, } Context::~Context() { - delete _state; + if(_version != Version::None) { + /* Context was not created */ + delete _state; + } if(currentContext == this) currentContext = nullptr; }