Hi,

>From a debug trace and with a DLOP_STEREO layer and when a layer is
released (when IDirectFBDisplayLayer_Destruct() is called), I can see
that only the last selected eye - related buffers for the primary
surface are released.

Wouldn't be more correct to apply the same processing as in
dfb_surface_reconfig() or even dfb_surface_create() in order to
relinquish all the buffers?
The attached patch provides the eventual fix.

Thanks,

-Ilyes
From e19f9802d4414a8714fd3c34465468ec423ef247 Mon Sep 17 00:00:00 2001
From: Ilyes Gouta <ilyes.go...@gmail.com>
Date: Wed, 5 Oct 2011 23:10:55 +0100
Subject: [PATCH] surface: decouple both left and right eyes buffers in
 dfb_surface_destroy_buffers()

---
 src/core/surface.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/core/surface.c b/src/core/surface.c
index 914e7d6..ac0ef55 100644
--- a/src/core/surface.c
+++ b/src/core/surface.c
@@ -630,7 +630,8 @@ error:
 DFBResult
 dfb_surface_destroy_buffers( CoreSurface *surface )
 {
-     int i;
+     int i, num_eyes;
+     DFBSurfaceStereoEye eye;
 
      D_MAGIC_ASSERT( surface, CoreSurface );
 
@@ -643,10 +644,15 @@ dfb_surface_destroy_buffers( CoreSurface *surface )
      }
 
      /* Destroy the Surface Buffers. */
-     for (i=0; i<surface->num_buffers; i++) {
-          dfb_surface_buffer_decouple( surface->buffers[i] );
-          surface->buffers[i] = NULL;
+     num_eyes = surface->config.caps & DSCAPS_STEREO ? 2 : 1;
+     for (eye = DSSE_LEFT; num_eyes > 0; num_eyes--, eye = DSSE_RIGHT) {
+          dfb_surface_set_stereo_eye(surface, eye);
+          for (i = 0; i < surface->num_buffers; i++) {
+               dfb_surface_buffer_decouple( surface->buffers[i] );
+               surface->buffers[i] = NULL;
+          }
      }
+     dfb_surface_set_stereo_eye(surface, DSSE_LEFT);
 
      surface->num_buffers = 0;
 
-- 
1.7.6.4

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to