aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
authorJordan Halase <jordan@halase.me>2019-10-22 14:54:47 -0500
committerDavid Robillard <d@drobilla.net>2019-11-03 20:52:32 +0100
commita96511e36737284589361616f4fb4c0874095da7 (patch)
tree673fef8758a901db01ff68eb24108f918dbda4b6 /pugl/detail/win.c
parent3d6b80ccb48068b001efd6ff369386e69c21c580 (diff)
downloadpugl-a96511e36737284589361616f4fb4c0874095da7.tar.gz
pugl-a96511e36737284589361616f4fb4c0874095da7.tar.bz2
pugl-a96511e36737284589361616f4fb4c0874095da7.zip
Fix puglFreeView() crashes when window creation failed
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c5
1 files changed, 4 insertions, 1 deletions
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);