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

[#3116] Delete history items

parent 8e14a8a7
......@@ -32,9 +32,19 @@ 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
_history_items.clear ();
}
int HistoryManager::load_history (int limit, std::string path)
......
......@@ -91,9 +91,10 @@ ManagerImpl::ManagerImpl (void) :
// never call if we use only the singleton...
ManagerImpl::~ManagerImpl (void) {
// terminate();
delete _cleaner;
_cleaner = 0;
_debug ("%s stop correctly.", PROGNAME);
delete _cleaner; _cleaner = NULL;
delete _history; _history = NULL;
_debug ("Manager: %s stop correctly.", PROGNAME);
}
void ManagerImpl::init () {
......@@ -104,7 +105,7 @@ void ManagerImpl::init () {
initVolume();
if (_exist == 0) {
_debug ("Cannot create config file in your home directory");
_warn ("Manager: Cannot create config file in your home directory");
}
initAudioDriver();
......@@ -119,11 +120,11 @@ void ManagerImpl::init () {
if (audiolayer != 0) {
unsigned int sampleRate = audiolayer->getSampleRate();
_debugInit ("Load Telephone Tone");
_debugInit ("Manager: Load telephone tone");
std::string country = getConfigString(PREFERENCES, ZONE_TONE);
_telephoneTone = new TelephoneTone(country, sampleRate);
_debugInit ("Loading DTMF key");
_debugInit ("Manager: Loading DTMF key");
_dtmfKey = new DTMF(sampleRate);
}
......@@ -135,23 +136,25 @@ void ManagerImpl::init () {
}
void ManagerImpl::terminate () {
_debug ("ManagerImpl::terminate ");
_debug ("Manager: Terminate ");
saveConfig();
unloadAccountMap();
_debug ("Unload DTMF Key ");
_debug ("Manager: Unload DTMF key");
delete _dtmfKey;
_debug ("Unload Audio Driver ");
delete _audiodriver;
_audiodriver = NULL;
_debug("Manager: Unload telephone tone");
delete _telephoneTone; _telephoneTone = NULL;
_debug ("Manager: Unload audio driver");
delete _audiodriver; _audiodriver = NULL;
_debug ("Unload Telephone Tone ");
delete _telephoneTone;
_telephoneTone = NULL;
_debug ("Manager: Unload telephone tone");
delete _telephoneTone; _telephoneTone = NULL;
_debug ("Unload Audio Codecs ");
_debug ("Manager: Unload audio codecs ");
_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