diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-06-17 15:56:48 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-06-17 18:15:34 -0700 |
| commit | 081145be27acbff75773a8f5a03a774224221d5d (patch) | |
| tree | 849dc200734e5bf55cc7564fe0272472acd7019f /src/image.cpp | |
| parent | e7858e8d4d7f9788eaac04b50ed3b87c9f8bb112 (diff) | |
Refactor egl/glx/image code to be more stylistically consistent
Diffstat (limited to 'src/image.cpp')
| -rw-r--r-- | src/image.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/image.cpp b/src/image.cpp index 4462ecc..f6e7ee4 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -9,8 +9,8 @@ #include <err.h> #include <stdlib.h> -#include "device_config.h" #include "image.h" +#include "device_config.h" void cleanup_state_image (void *data) @@ -55,7 +55,7 @@ createImageWindow(image_state_t *state, const device_config_t& device_config) } void -updateImageWindow(image_state_t* state) +updateImageWindow (image_state_t* state) { XPutImage (state->dpy, state->window, state->gc, &state->image, 0, 0, @@ -63,12 +63,15 @@ updateImageWindow(image_state_t* state) state->width, state->height); XSync (state->dpy, False); } + void -destroyImageWindow(image_state_t* state) +destroyImageWindow (image_state_t* state) { - XFreeGC (state->dpy, state->gc); - XDestroyWindow (state->dpy, state->window); - XCloseDisplay (state->dpy); + if (state->dpy) { + XFreeGC (state->dpy, state->gc); + XDestroyWindow (state->dpy, state->window); + XCloseDisplay (state->dpy); + } } /* |