What unpinned mean?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
parapoohda
Posts: 92
Joined: Fri May 31, 2019 6:30 am

What unpinned mean?

Post by parapoohda »

Code: Select all

 Debug.Assert(totalBlockCount == 0 || !Pinned, "Memory leak warning! Don't let a buffer pool die without unpinning it!");
Does this mean I have to dispose buffer pool?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: What unpinned mean?

Post by Norbo »

Yup- a pool should not have any outstanding allocations when it is being finalized, or else that memory will be permanently lost to the process. Call pool.Clear() to drop all allocations. BufferPool's explicitly implemented Dispose function just calls Clear.

(Notably, if the process is shutting down, clearing the allocations isn't technically required. The OS will free up all the memory.)
parapoohda
Posts: 92
Joined: Fri May 31, 2019 6:30 am

Re: What unpinned mean?

Post by parapoohda »

Thank you
Post Reply