[ekiga/gnome-2-26] Fixed crashes shown as assertion failed in /usr/include/ptlib/safecoll.h:813



commit 28da00ea95b12c12ed61d37d4ab37084242dd847
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date:   Tue Jul 21 12:23:41 2009 +0200

    Fixed crashes shown as assertion failed in /usr/include/ptlib/safecoll.h:813
    
    The fix is the same as 43c6c4, but in other places in the source code.
    
    The crash was 100% reproducible: Start ekiga, wait until it registers.
    Add in the URI echo ekiga net, call, you receive an error.  Go with
    cursor in the URI, remove echo, type 500, but immediately after typing
    5, there is crash.

 lib/engine/components/opal/opal-call.cpp |   54 +++--------------------------
 1 files changed, 6 insertions(+), 48 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index b88148c..2a4a9d4 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -141,16 +141,7 @@ Opal::Call::answer ()
 void
 Opal::Call::transfer (std::string uri)
 {
-  PSafePtr<OpalConnection> connection = NULL;
-
-  int i = 0;
-
-  do {
-
-    connection = GetConnection (i);
-    i++;
-  }  while (PIsDescendant(&(*connection), OpalPCSSConnection));
-
+  PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
   if (connection)
     connection->TransferConnection (uri);
 }
@@ -159,17 +150,8 @@ Opal::Call::transfer (std::string uri)
 void
 Opal::Call::toggle_hold ()
 {
-  PSafePtr<OpalConnection> connection = NULL;
-
   bool on_hold = false;
-  int i = 0;
-
-  do {
-
-    connection = GetConnection (i);
-    i++;
-  }  while (PIsDescendant(&(*connection), OpalPCSSConnection));
-
+  PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
   if (connection) {
 
     on_hold = connection->IsConnectionOnHold ();
@@ -185,20 +167,12 @@ void
 Opal::Call::toggle_stream_pause (StreamType type)
 {
   OpalMediaStreamPtr stream = NULL;
-  PSafePtr<OpalConnection> connection = NULL;
   PString codec_name;
   std::string stream_name;
 
   bool paused = false;
 
-  int i = 0;
-
-  do {
-
-    connection = GetConnection (i);
-    i++;
-  }  while (PIsDescendant(&(*connection), OpalPCSSConnection));
-
+  PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
   if (connection != NULL) {
 
     stream = connection->GetMediaStream ((type == Audio) ? OpalMediaType::Audio () : OpalMediaType::Video (), false);
@@ -221,16 +195,7 @@ Opal::Call::toggle_stream_pause (StreamType type)
 void
 Opal::Call::send_dtmf (const char dtmf)
 {
-  PSafePtr<OpalConnection> connection = NULL;
-
-  int i = 0;
-
-  do {
-
-    connection = GetConnection (i);
-    i++;
-  }  while (PIsDescendant(&(*connection), OpalPCSSConnection));
-
+  PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
   if (connection != NULL)
     connection->SendUserInputTone (dtmf, 180);
 }
@@ -667,19 +632,12 @@ void
 Opal::Call::OnNoAnswerTimeout (PTimer &,
                                INT) 
 {
-  PSafePtr<OpalConnection> connection = NULL;
-  int i = 0;
-
   if (!is_outgoing ()) {
 
     if (!forward_uri.empty ()) {
 
-      do {
-        connection = GetConnection (i);
-        i++;
-      }  while (PIsDescendant(&(*connection), OpalPCSSConnection));
-
-      if (!PIsDescendant(&(*connection), OpalPCSSConnection)) 
+      PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
+      if (connection != NULL)
         connection->ForwardCall (forward_uri);
     }
     else



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