24 ReleaseManager<T>::ReleaseManager(
void (*releaseFunction)(T*)):
25 _releaseFunction(releaseFunction) {}
28 ReleaseManager<T>::~ReleaseManager() {
30 for(
unsigned i=0; i < (unsigned) _releaseQueue.size(); ++i)
32 if(*_releaseQueue.at(i)) {
35 _releaseFunction(*_releaseQueue.at(i));
37 delete *_releaseQueue.at(i);
40 for(
unsigned i=0; i < (unsigned) _releaseAddressQueue.size(); ++i)
42 if(_releaseAddressQueue.at(i)) {
45 _releaseFunction(_releaseAddressQueue.at(i));
47 delete _releaseAddressQueue.at(i);
53 void ReleaseManager<T>::add(T** var) {
55 _releaseQueue.push_back(var);
59 void ReleaseManager<T>::add(T* address) {
61 _releaseAddressQueue.push_back(address);