fixed wrong delete

This commit is contained in:
Matej Sekoranja
2011-01-03 12:47:22 +01:00
parent 7d9b5ce725
commit 571405d6b2
2 changed files with 5 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ namespace epics { namespace pvData {
}
BitSet::~BitSet() {
delete words;
delete[] words;
Lock xx(globalMutex);
totalDestruct++;
@@ -68,7 +68,7 @@ namespace epics { namespace pvData {
void BitSet::initWords(uint32 nbits) {
uint32 length = (nbits <= 0) ? 1 : wordIndex(nbits-1) + 1;
if (words) delete words;
if (words) delete[] words;
words = new uint64[length];
bzero(words, sizeof(uint64)*length);
wordsLength = length;
@@ -95,7 +95,7 @@ namespace epics { namespace pvData {
uint64* newwords = new uint64[wordsRequired];
bzero(newwords, sizeof(uint64)*wordsRequired);
memcpy(newwords, words, sizeof(uint64)*wordsLength);
if (words) delete words;
if (words) delete[] words;
words = newwords;
wordsLength = wordsRequired;
}
@@ -315,7 +315,7 @@ namespace epics { namespace pvData {
// we ensure that words array size is adequate (and not wordsInUse to ensure capacity to the future)
if (wordsLength < set.wordsLength)
{
if (words) delete words;
if (words) delete[] words;
words = new uint64[set.wordsLength];
wordsLength = set.wordsLength;
}