[ekiga/ds-opal-refactoring] Opal: Make sure the Opal::Bank is only added once.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-opal-refactoring] Opal: Make sure the Opal::Bank is only added once.
- Date: Sun, 12 Apr 2015 13:27:31 +0000 (UTC)
commit 7fe7d3ae31033322a4829bd1f9a570d99c56818e
Author: Damien Sandras <dsandras seconix com>
Date: Sun Apr 12 15:22:56 2015 +0200
Opal: Make sure the Opal::Bank is only added once.
It could have been added several times if the user plays with STUN
settings.
lib/engine/components/opal/opal-main.cpp | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index 370f27d..d3c7182 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -61,7 +61,7 @@ using namespace Opal;
class OPALSpark: public Ekiga::Spark
{
public:
- OPALSpark (): result(false)
+ OPALSpark (): result(false), bank_created(false)
{}
@@ -71,18 +71,21 @@ public:
#endif
Opal::Sip::EndPoint& sip_endpoint)
{
- boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
- boost::shared_ptr<Ekiga::AccountCore> account_core = core.get<Ekiga::AccountCore> ("account-core");
- boost::shared_ptr<Opal::Bank> bank = boost::shared_ptr<Opal::Bank> (new Opal::Bank (core,
+ if (!bank_created) {
+ boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
+ boost::shared_ptr<Ekiga::AccountCore> account_core = core.get<Ekiga::AccountCore> ("account-core");
+ boost::shared_ptr<Opal::Bank> bank = boost::shared_ptr<Opal::Bank> (new Opal::Bank (core,
#ifdef HAVE_H323
- &h323_endpoint,
+ &h323_endpoint,
#endif
- &sip_endpoint));
+ &sip_endpoint));
- account_core->add_bank (bank);
- presence_core->add_cluster (bank);
- core.add (bank);
- presence_core->add_presence_publisher (bank);
+ account_core->add_bank (bank);
+ presence_core->add_cluster (bank);
+ core.add (bank);
+ presence_core->add_presence_publisher (bank);
+ bank_created = true;
+ }
}
@@ -149,6 +152,7 @@ public:
{ return "OPAL"; }
bool result;
+ bool bank_created;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]