From a96511e36737284589361616f4fb4c0874095da7 Mon Sep 17 00:00:00 2001 From: Jordan Halase Date: Tue, 22 Oct 2019 14:54:47 -0500 Subject: Fix puglFreeView() crashes when window creation failed --- pugl/detail/win.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pugl/detail/win.c') diff --git a/pugl/detail/win.c b/pugl/detail/win.c index 90c133f..408e7ba 100644 --- a/pugl/detail/win.c +++ b/pugl/detail/win.c @@ -211,7 +211,10 @@ void puglFreeViewInternals(PuglView* view) { if (view) { - view->backend->destroy(view); + if (view->backend) { + view->backend->destroy(view); + } + ReleaseDC(view->impl->hwnd, view->impl->hdc); DestroyWindow(view->impl->hwnd); free(view->impl); -- cgit v1.2.1