comparison src/context.cpp @ 146:7278c9766e26

free old configs when last reference goes away
author carl
date Sun, 15 Oct 2006 17:21:07 -0700
parents 9b9bab1d3c21
children 9330b8d6a56b
comparison
equal deleted inserted replaced
145:9b9bab1d3c21 146:7278c9766e26
393 default_context = NULL; 393 default_context = NULL;
394 } 394 }
395 395
396 396
397 CONFIG::~CONFIG() { 397 CONFIG::~CONFIG() {
398 if (debug_syslog) {
399 char buf[maxlen];
400 snprintf(buf, sizeof(buf), "freeing memory for old configuration generation %d", generation);
401 my_syslog(buf);
402 }
398 for (context_list::iterator i=contexts.begin(); i!=contexts.end(); i++) { 403 for (context_list::iterator i=contexts.begin(); i!=contexts.end(); i++) {
399 CONTEXT *c = *i; 404 CONTEXT *c = *i;
400 delete c; 405 delete c;
401 } 406 }
402 } 407 }