piDeleteAll and piDeleteAllAndClear

This commit is contained in:
2022-11-13 22:55:10 +03:00
parent 46751ab977
commit 57ed40912d
2 changed files with 10 additions and 0 deletions

View File

@@ -868,6 +868,15 @@ template<> inline uint piHash(const float & v) {return (uint)v;}
template<> inline uint piHash(const double & v) {return piHashData((const uchar *)&v, sizeof(v));}
template<> inline uint piHash(const ldouble & v) {return piHashData((const uchar *)&v, sizeof(v));}
template<typename T> inline void piDeleteAll(T & container) {
for (auto i: container)
delete i;
}
template<typename T> inline void piDeleteAllAndClear(T & container) {
piDeleteAll(container);
container.clear();
}
#define piRoundf piRound<float>
#define piRoundd piRound<double>
#define piComparef piCompare<float>

View File

@@ -194,6 +194,7 @@ PIObject::~PIObject() {
mutexObjects().unlock();
deleted(this);
piDisconnectAll();
_signature_ = 0;
}