ekiga r6032 - in trunk: . lib/engine lib/engine/display/skel lib/engine/hal/skel lib/engine/vidinput/skel



Author: mschneid
Date: Wed Mar  5 07:40:48 2008
New Revision: 6032
URL: http://svn.gnome.org/viewvc/ekiga?rev=6032&view=rev

Log:
Fix segfault on exit due to incorrect destruction order.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/display/skel/display-core.cpp
   trunk/lib/engine/engine.cpp
   trunk/lib/engine/hal/skel/hal-core.cpp
   trunk/lib/engine/vidinput/skel/vidinput-core.cpp

Modified: trunk/lib/engine/display/skel/display-core.cpp
==============================================================================
--- trunk/lib/engine/display/skel/display-core.cpp	(original)
+++ trunk/lib/engine/display/skel/display-core.cpp	Wed Mar  5 07:40:48 2008
@@ -60,6 +60,10 @@
 
 DisplayCore::~DisplayCore ()
 {
+#ifdef __GNUC__
+  std::cout << __PRETTY_FUNCTION__ << std::endl;
+#endif
+
   PWaitAndSignal m(var_mutex);
 
   if (display_core_conf_bridge)

Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp	(original)
+++ trunk/lib/engine/engine.cpp	Wed Mar  5 07:40:48 2008
@@ -92,6 +92,10 @@
              Ekiga::ServiceCore * &core)
 {
   core = new Ekiga::ServiceCore; 
+
+  /* VidInputCore depends on DisplayCore and must this              *
+   * be constructed thereafter                                      */
+
   Ekiga::PresenceCore *presence_core = new Ekiga::PresenceCore;
   Ekiga::ContactCore *contact_core = new Ekiga::ContactCore;
   Ekiga::CallCore *call_core = new Ekiga::CallCore;
@@ -99,13 +103,21 @@
   Ekiga::VidInputCore *vidinput_core = new Ekiga::VidInputCore(*display_core);
   Ekiga::HalCore *hal_core = new Ekiga::HalCore;
 
+
+  /* The last item in the following list will be destroyed first.   *
+   * - VidInputCore must be destroyed before DisplayCore since its  *
+   *   PreviewManager may call functions of DisplayCore.            *
+   * - The runtime should be destroyed last since other core        *
+   *   components may still call runtime functions until destroyed  *
+   *   (e.g. DisplayCore).                                          */
+   
+  core->add (*runtime);
   core->add (*contact_core);
   core->add (*presence_core);
   core->add (*call_core);
-  core->add (*vidinput_core);
   core->add (*display_core);
+  core->add (*vidinput_core);
   core->add (*hal_core);
-  core->add (*runtime);
 
   if (!gmconf_personal_details_init (*core, &argc, &argv)) {
     delete core;

Modified: trunk/lib/engine/hal/skel/hal-core.cpp
==============================================================================
--- trunk/lib/engine/hal/skel/hal-core.cpp	(original)
+++ trunk/lib/engine/hal/skel/hal-core.cpp	Wed Mar  5 07:40:48 2008
@@ -51,6 +51,9 @@
 
 HalCore::~HalCore ()
 {
+#ifdef __GNUC__
+  std::cout << __PRETTY_FUNCTION__ << std::endl;
+#endif
 }
 
 

Modified: trunk/lib/engine/vidinput/skel/vidinput-core.cpp
==============================================================================
--- trunk/lib/engine/vidinput/skel/vidinput-core.cpp	(original)
+++ trunk/lib/engine/vidinput/skel/vidinput-core.cpp	Wed Mar  5 07:40:48 2008
@@ -136,6 +136,10 @@
 
 VidInputCore::~VidInputCore ()
 {
+#ifdef __GNUC__
+  std::cout << __PRETTY_FUNCTION__ << std::endl;
+#endif
+
   PWaitAndSignal m(var_mutex);
 
   if (vidinput_core_conf_bridge)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]