From 70c1be1afab841f6c351cf758b600f6e4b958e00 Mon Sep 17 00:00:00 2001
From: Timothy Strelchun <Timothy.Strelchun@Intel.Com>
Date: Sat, 19 Jun 2010 21:53:47 -0700
Subject: [PATCH 4/6] Enable Fusion message dispatching usage during shutdown

Delayed stopping the Fusion dispatcher in dfb_core_shutdown(). The Fusion
dispatcher is needed to handle Fusion events during the releasing of resources.
---
 src/core/core.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/core/core.c b/src/core/core.c
index c7f3f2e..05534e7 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -1,5 +1,5 @@
 /*
-   (c) Copyright 2001-2009  The world wide DirectFB Open Source Community (directfb.org)
+   (c) Copyright 2001-2010  The world wide DirectFB Open Source Community (directfb.org)
    (c) Copyright 2000-2004  Convergence (integrated media) GmbH
 
    All rights reserved.
@@ -925,7 +925,9 @@ dfb_core_shutdown( CoreDFB *core, bool emergency )
      if (dfb_wm_core.initialized)
           dfb_wm_close_all_stacks( dfb_wm_core.data_local );
 
-     fusion_stop_dispatcher( core->world, emergency );
+     /* Do not stop the Fusion dispatcher here so it can be used for resource releasing 
+      * related events during shutdown.
+      */
 
      /* Destroy layer context and region objects. */
      fusion_object_pool_destroy( shared->layer_region_pool, core->world );
@@ -953,6 +955,11 @@ dfb_core_shutdown( CoreDFB *core, bool emergency )
      /* Destroy shared memory pool for surface data. */
      fusion_shm_pool_destroy( core->world, shared->shmpool_data );
 
+     /* Delayed stopping the Fusion dispatcher to enable resource releasing related 
+      * events to be handled during shutdown.
+      */
+     fusion_stop_dispatcher( core->world, emergency );
+
      return 0;
 }
 
-- 
1.6.1.9.g97c34

