27.08.2019 3:59, Adriano dos Santos Fernandes wrote:

Sometimes a object managed by memory-pool may embed non-pooled memory or
other resources.

If the main object is not explicitly destroyed, i.e., destroyed by pool,
the embedded objects leak.

True. And this requires us to avoid the "delete-by-pool" practice and destroy such objects explicitly. Which is usually good per se, unless performance is affected (e.g. millions of small objects inside the pool).

I've added a way in the work/re2 branch to attach these resources to
memory pool lifecycle and detach if the main object is explicitly destroyed.

https://github.com/FirebirdSQL/firebird/commit/ff06569f127caf3128a5b3290f67eb468f86fe8d

Generally, I don't mind. Although see above, explicit destruction may be a better way to handle the resource lifetime.


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to