aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r--pugl/detail/x11.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 429d89f..7bf5223 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -266,12 +266,16 @@ puglHideWindow(PuglView* view)
void
puglFreeViewInternals(PuglView* view)
{
- if (view) {
+ if (view && view->impl) {
if (view->impl->xic) {
XDestroyIC(view->impl->xic);
}
- view->backend->destroy(view);
- XDestroyWindow(view->impl->display, view->impl->win);
+ if (view->backend) {
+ view->backend->destroy(view);
+ }
+ if (view->impl->display) {
+ XDestroyWindow(view->impl->display, view->impl->win);
+ }
XFree(view->impl->vi);
free(view->impl);
}