summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-09-17 13:05:50 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-09-17 13:05:50 +0200
commitbe07e5448f54fbd84c5299cbadfd097d1ce893db (patch)
tree8bbf751362410a64e5587198d17245e734764e09 /src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
parent824818303ce41a57de3220375bc42b6433cbec0c (diff)
Improve reuse of mmap'ed data by Wayland buffers
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 9ccebc669..969a4f0c1 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1252,6 +1252,16 @@ void Fl_Wayland_Screen_Driver::open_display_platform() {
void Fl_Wayland_Screen_Driver::close_display() {
+ if (Fl_Wayland_Graphics_Driver::pool ) {
+ struct Fl_Wayland_Graphics_Driver::wld_shm_pool_data *pool_data =
+ (struct Fl_Wayland_Graphics_Driver::wld_shm_pool_data *)
+ wl_shm_pool_get_user_data(Fl_Wayland_Graphics_Driver::pool);
+ wl_shm_pool_destroy(Fl_Wayland_Graphics_Driver::pool);
+ /*int err = */munmap(pool_data->pool_memory, pool_data->pool_size);
+ //printf("munmap(%p)->%d\n", pool_data->pool_memory, err);
+ free(pool_data);
+ Fl_Wayland_Graphics_Driver::pool = NULL;
+ }
if (text_input_base) {
disable_im();
zwp_text_input_manager_v3_destroy(text_input_base);