aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-19 12:15:55 +0200
committerDavid Robillard <d@drobilla.net>2020-10-19 12:47:39 +0200
commita87395423915f913b819291b3b4920501cccdf95 (patch)
treec748467f9923d3f120abb64cd8ce12f367abab19 /pugl/detail/win.c
parentf2e294f99b42becc35588673f45a2d536e1091fa (diff)
downloadpugl-a87395423915f913b819291b3b4920501cccdf95.tar.gz
pugl-a87395423915f913b819291b3b4920501cccdf95.tar.bz2
pugl-a87395423915f913b819291b3b4920501cccdf95.zip
Gracefully handle puglRealize() being called twice
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index b29ccf4..b3ba00d 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -165,6 +165,9 @@ PuglStatus
puglRealize(PuglView* view)
{
PuglInternals* impl = view->impl;
+ if (impl->hwnd) {
+ return PUGL_FAILURE;
+ }
// Getting depth from the display mode seems tedious, just set usual values
if (view->hints[PUGL_RED_BITS] == PUGL_DONT_CARE) {