[ekiga] Fixed the leak of Opal::Call objects created by previous commit



commit 42940e42561cd43ef53e5c604be2f1c0d6219b97
Author: Julien Puydt <jpuydt free fr>
Date:   Mon Feb 11 21:27:59 2013 +0100

    Fixed the leak of Opal::Call objects created by previous commit

 lib/engine/components/opal/opal-call-manager.cpp |   12 ++----------
 lib/engine/components/opal/opal-call-manager.h   |    1 -
 lib/engine/components/opal/opal-call.cpp         |    2 ++
 3 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call-manager.cpp b/lib/engine/components/opal/opal-call-manager.cpp
index 3500e6c..c8b6bb8 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -772,17 +772,9 @@ OpalCall *CallManager::CreateCall (void *uri)
 }
 
 void
-CallManager::emit_removed_in_main (Ekiga::Call* call)
+CallManager::DestroyCall (OpalCall* call)
 {
-  call->removed ();
-}
-
-void
-CallManager::DestroyCall (OpalCall *_call)
-{
-  Ekiga::Call *call = dynamic_cast<Ekiga::Call *> (_call);
-
-  Ekiga::Runtime::run_in_main(boost::bind (&CallManager::emit_removed_in_main, this, call));
+  delete call;
 }
 
 
diff --git a/lib/engine/components/opal/opal-call-manager.h b/lib/engine/components/opal/opal-call-manager.h
index fbfb22a..22bac86 100644
--- a/lib/engine/components/opal/opal-call-manager.h
+++ b/lib/engine/components/opal/opal-call-manager.h
@@ -180,7 +180,6 @@ private:
 
     void create_call_in_main (Opal::Call* call);
     OpalCall *CreateCall (void *uri);
-    void emit_removed_in_main (Ekiga::Call* call);
     virtual void DestroyCall (OpalCall *);
 
     virtual bool OnOpenMediaStream (OpalConnection &,
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 413a594..9f89a6a 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -118,6 +118,7 @@ Opal::Call::Call (Opal::CallManager& _manager,
 
 Opal::Call::~Call ()
 {
+  std::cout << __PRETTY_FUNCTION__ << std::endl;
 }
 
 void
@@ -704,6 +705,7 @@ void
 Opal::Call::emit_cleared_in_main (const std::string reason)
 {
   cleared (reason);
+  removed ();
 }
 
 void


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