File: tjstatic.cpp

package info (click to toggle)
odin 2.0.5-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,196 kB
  • sloc: cpp: 62,638; sh: 4,541; makefile: 779
file content (27 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "tjstatic.h"


void Static::append_to_destructor_list(Static* sp) {
  if(!destructor_list) {
    destructor_list=new STD_list<Static*>;
  }
  destructor_list->push_front(sp);
}


void Static::destroy_all() {
  if(destructor_list) {
    for(STD_list<Static*>::iterator it=destructor_list->begin(); it!=destructor_list->end(); ++it) {
//      STD_cout << "Static::destroy_all(): destructing " << typeid(*(*it)).name() << "<" << STD_endl;
      delete *it;
//      STD_cout << "Static::destroy_all(): done" << STD_endl;
    }
    delete destructor_list;
  }
  destructor_list=0;
}


STD_list<Static*>* Static::destructor_list=0;