Skip to content

Commit 730c137

Browse files
committed
Merge branch 'master' into refactor/tokenizer
2 parents 7361007 + 425aa48 commit 730c137

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

source/core/math/randomsequence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Vector2d Uniform2dOnSquare(SequentialDoubleGeneratorPtr source)
226226
{
227227
double x = (*source)();
228228
double y = (*source)();
229-
return Vector2d((*source)(), (*source)());
229+
return Vector2d(x, y);
230230
}
231231

232232
Vector2d Uniform2dOnDisc(SequentialDoubleGeneratorPtr source)

source/core/support/simplevector.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,23 @@ class VectorPool
627627
{
628628
if (initialPoolSize != 0)
629629
mPool.reserve(initialPoolSize);
630+
#ifdef POV_CORE_DEBUG
631+
mAllocCount = 0;
632+
#endif
633+
}
634+
635+
~VectorPool()
636+
{
637+
for (auto&& p : mPool)
638+
{
639+
delete p;
640+
#ifdef POV_CORE_DEBUG
641+
--mAllocCount;
642+
#endif
643+
}
644+
#ifdef POV_CORE_DEBUG
645+
POV_CORE_ASSERT(mAllocCount == 0);
646+
#endif
630647
}
631648

632649
VectorPool(const VectorPool&) = delete;
@@ -638,6 +655,9 @@ class VectorPool
638655
if (mPool.empty())
639656
{
640657
p = new VECTOR_T();
658+
#ifdef POV_CORE_DEBUG
659+
++mAllocCount;
660+
#endif
641661
}
642662
else
643663
{
@@ -660,6 +680,9 @@ class VectorPool
660680

661681
vector<VECTOR_T*> mPool;
662682
size_t mSizeHint;
683+
#ifdef POV_CORE_DEBUG
684+
size_t mAllocCount;
685+
#endif
663686
};
664687

665688
//******************************************************************************

0 commit comments

Comments
 (0)