Signed-off-by: Jean-Christophe DUBOIS <j...@tribudubois.net>
---
 src/core/wm.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/core/wm.c b/src/core/wm.c
index 1f3cf56..7add3d2 100644
--- a/src/core/wm.c
+++ b/src/core/wm.c
@@ -415,9 +415,13 @@ dfb_wm_layer_context_callback( FusionObjectPool *pool,
 
      D_DEBUG_AT( Core_WM, "  -> ref context %p...\n", context );
 
-     dfb_layer_context_ref( context );
+     if (dfb_layer_context_ref( context ))
+          return false;
 
-     dfb_layer_context_lock( context );
+     if (dfb_layer_context_lock( context )) {
+          dfb_layer_context_unref( context );
+          return false;
+     }
 
      if (context->stack) {
           if ((context->stack->flags & CWSF_ACTIVATED) & flags)
@@ -449,6 +453,7 @@ dfb_wm_deactivate_all_stacks( void *data )
 
      shared = local->shared;
      D_MAGIC_ASSERT( shared, DFBWMCoreShared );
+     (void)shared;
 
      dfb_core_enum_layer_contexts( local->core, dfb_wm_layer_context_callback, 
(void*)(long) CWSF_ACTIVATED );
 
@@ -465,6 +470,7 @@ dfb_wm_close_all_stacks( void *data )
 
      local = data;
      D_MAGIC_ASSERT( local, DFBWMCore );
+     (void)shared;
 
      shared = local->shared;
      D_MAGIC_ASSERT( shared, DFBWMCoreShared );
@@ -664,7 +670,9 @@ dfb_wm_layer_context_WINDOW_ADD_callback( FusionObjectPool 
*pool,
      AttachContext    *ctx     = _ctx;
      CoreLayerContext *context = (CoreLayerContext *) object;
 
-     dfb_layer_context_lock( context );
+     if (dfb_layer_context_lock( context )) {
+          return false;
+     }
 
      if (context->stack) {
           ret = dfb_wm_enum_windows( context->stack, 
wm_window_attach_callback, ctx );
-- 
1.9.1

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

Reply via email to