Re: [Ekiga-devel-list] Win32 master crash on account remove



Michael Rickmann schrieb:
This is the last one for tonight and a rather old one. It occurs when I "Remove" an account in the accounts window. We do not have it in stable and I can not remember when it appeared in head/master. It must have been before June 09. To get a more meaning backtrace than the attached one (bt then tread apply all bt), I guess, I have to revert to a state before we had split ekiga into an exe and a dll.
Michael

The reason for this crash was that the account was destructed first on Win32 before the unsubscriber thread had finished. It was asking for the (possibly half existing) account's aor. I have attached two alternative patches which fix this. I favour the second one which hooks the account destruction into the call back chain. What do you think?
Michael
diff -ur src/ekiga/lib/engine/components/opal/opal-account.cpp ekiga/lib/engine/components/opal/opal-account.cpp
--- src/ekiga/lib/engine/components/opal/opal-account.cpp	2009-10-25 07:02:43.000000000 +0100
+++ ekiga/lib/engine/components/opal/opal-account.cpp	2009-10-27 20:30:52.000000000 +0100
@@ -321,7 +321,9 @@
   dead = true;
 
   boost::shared_ptr<Sip::EndPoint> endpoint = core.get<Sip::EndPoint> ("opal-sip-endpoint");
+
   endpoint->unsubscribe (*this);
+  PThread::Sleep (5);	// yield
 
   trigger_saving ();
 
diff -ur src/ekiga/lib/engine/components/opal/opal-account.cpp ekiga/lib/engine/components/opal/opal-account.cpp
--- src/ekiga/lib/engine/components/opal/opal-account.cpp	2009-10-27 20:57:56.000000000 +0100
+++ ekiga/lib/engine/components/opal/opal-account.cpp	2009-10-29 18:41:13.000000000 +0100
@@ -333,8 +333,6 @@
   endpoint->unsubscribe (*this);
 
   trigger_saving ();
-
-  removed ();
 }
 
 
@@ -499,6 +497,10 @@
 
     status = _("Unregistered");
     updated ();
+    /* delay destruction of this account until the
+       unsubscriber thread has called back */
+    if (dead)
+      removed ();
     break;
 
   case UnregistrationFailed:


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