Commit 92df44c8 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3116] Delete history items

parent 8e14a8a7
...@@ -32,9 +32,19 @@ HistoryManager::HistoryManager () ...@@ -32,9 +32,19 @@ HistoryManager::HistoryManager ()
HistoryManager::~HistoryManager () HistoryManager::~HistoryManager ()
{ {
HistoryItemMap::iterator iter = _history_items.begin();
HistoryItem * item;
while(iter != _history_items.end()){
item = iter->second;
delete item;
iter++;
}
// Clear the history map // Clear the history map
_history_items.clear (); _history_items.clear ();
} }
int HistoryManager::load_history (int limit, std::string path) int HistoryManager::load_history (int limit, std::string path)
......
...@@ -91,9 +91,10 @@ ManagerImpl::ManagerImpl (void) : ...@@ -91,9 +91,10 @@ ManagerImpl::ManagerImpl (void) :
// never call if we use only the singleton... // never call if we use only the singleton...
ManagerImpl::~ManagerImpl (void) { ManagerImpl::~ManagerImpl (void) {
// terminate(); // terminate();
delete _cleaner; delete _cleaner; _cleaner = NULL;
_cleaner = 0; delete _history; _history = NULL;
_debug ("%s stop correctly.", PROGNAME);
_debug ("Manager: %s stop correctly.", PROGNAME);
} }
void ManagerImpl::init () { void ManagerImpl::init () {
...@@ -104,7 +105,7 @@ void ManagerImpl::init () { ...@@ -104,7 +105,7 @@ void ManagerImpl::init () {
initVolume(); initVolume();
if (_exist == 0) { if (_exist == 0) {
_debug ("Cannot create config file in your home directory"); _warn ("Manager: Cannot create config file in your home directory");
} }
initAudioDriver(); initAudioDriver();
...@@ -119,11 +120,11 @@ void ManagerImpl::init () { ...@@ -119,11 +120,11 @@ void ManagerImpl::init () {
if (audiolayer != 0) { if (audiolayer != 0) {
unsigned int sampleRate = audiolayer->getSampleRate(); unsigned int sampleRate = audiolayer->getSampleRate();
_debugInit ("Load Telephone Tone"); _debugInit ("Manager: Load telephone tone");
std::string country = getConfigString(PREFERENCES, ZONE_TONE); std::string country = getConfigString(PREFERENCES, ZONE_TONE);
_telephoneTone = new TelephoneTone(country, sampleRate); _telephoneTone = new TelephoneTone(country, sampleRate);
_debugInit ("Loading DTMF key"); _debugInit ("Manager: Loading DTMF key");
_dtmfKey = new DTMF(sampleRate); _dtmfKey = new DTMF(sampleRate);
} }
...@@ -135,23 +136,25 @@ void ManagerImpl::init () { ...@@ -135,23 +136,25 @@ void ManagerImpl::init () {
} }
void ManagerImpl::terminate () { void ManagerImpl::terminate () {
_debug ("ManagerImpl::terminate ");
_debug ("Manager: Terminate ");
saveConfig(); saveConfig();
unloadAccountMap(); unloadAccountMap();
_debug ("Unload DTMF Key "); _debug ("Manager: Unload DTMF key");
delete _dtmfKey; delete _dtmfKey;
_debug ("Unload Audio Driver "); _debug("Manager: Unload telephone tone");
delete _audiodriver; delete _telephoneTone; _telephoneTone = NULL;
_audiodriver = NULL;
_debug ("Manager: Unload audio driver");
delete _audiodriver; _audiodriver = NULL;
_debug ("Unload Telephone Tone "); _debug ("Manager: Unload telephone tone");
delete _telephoneTone; delete _telephoneTone; _telephoneTone = NULL;
_telephoneTone = NULL;
_debug ("Unload Audio Codecs "); _debug ("Manager: Unload audio codecs ");
_codecDescriptorMap.deleteHandlePointer(); _codecDescriptorMap.deleteHandlePointer();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment