File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,20 @@ class VectorPool
629629 mPool .reserve (initialPoolSize);
630630 }
631631
632+ ~VectorPool ()
633+ {
634+ for (auto && p : mPool )
635+ {
636+ delete p;
637+ #ifdef POV_CORE_DEBUG
638+ --mAllocCount ;
639+ #endif
640+ }
641+ #ifdef POV_CORE_DEBUG
642+ POV_CORE_ASSERT (mAllocCount == 0 );
643+ #endif
644+ }
645+
632646 VectorPool (const VectorPool&) = delete ;
633647 VectorPool& operator =(VectorPool&) = delete ;
634648
@@ -638,6 +652,9 @@ class VectorPool
638652 if (mPool .empty ())
639653 {
640654 p = new VECTOR_T ();
655+ #ifdef POV_CORE_DEBUG
656+ ++mAllocCount ;
657+ #endif
641658 }
642659 else
643660 {
@@ -660,6 +677,9 @@ class VectorPool
660677
661678 vector<VECTOR_T*> mPool ;
662679 size_t mSizeHint ;
680+ #ifdef POV_CORE_DEBUG
681+ size_t mAllocCount ;
682+ #endif
663683};
664684
665685// ******************************************************************************
You can’t perform that action at this time.
0 commit comments