From 669cebe9a32074c7d47af1760e67d657ebfccb65 Mon Sep 17 00:00:00 2001
From: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
Date: Tue, 2 Oct 2007 16:04:41 -0400
Subject: [PATCH] Properly destroy everything on account removal.

---
 src/account.cpp    | 4 +++-
 src/iaxaccount.cpp | 1 +
 src/sipaccount.cpp | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/account.cpp b/src/account.cpp
index e05fafb0fe..6c9a82be1b 100644
--- a/src/account.cpp
+++ b/src/account.cpp
@@ -31,7 +31,9 @@ Account::Account(const AccountID& accountID) : _accountID(accountID)
 
 Account::~Account()
 {
-  delete _link; _link = NULL;
+  // _link should be destroyed WHERE IT'S CREATED
+  //delete _link;
+  //_link = NULL;
 }
 
 
diff --git a/src/iaxaccount.cpp b/src/iaxaccount.cpp
index 8241a544b2..7ee53768e0 100644
--- a/src/iaxaccount.cpp
+++ b/src/iaxaccount.cpp
@@ -32,6 +32,7 @@ IAXAccount::IAXAccount(const AccountID& accountID)
 IAXAccount::~IAXAccount()
 {
   delete _link;
+  _link = NULL;
 }
 
 void
diff --git a/src/sipaccount.cpp b/src/sipaccount.cpp
index b277e8eb96..722943f084 100644
--- a/src/sipaccount.cpp
+++ b/src/sipaccount.cpp
@@ -32,6 +32,7 @@ SIPAccount::SIPAccount(const AccountID& accountID)
 SIPAccount::~SIPAccount()
 {
   delete _link;
+  _link = NULL;
 }
 
 void
-- 
GitLab