Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认的Policy能否提供一个OnDestroy的回调函数 #1

Open
LeisurelyYang opened this issue Apr 1, 2019 · 2 comments
Open

默认的Policy能否提供一个OnDestroy的回调函数 #1

LeisurelyYang opened this issue Apr 1, 2019 · 2 comments

Comments

@LeisurelyYang
Copy link

我现在用这个时,把IntPtr指针对象放在对象池了,因为在程序关闭时我需要释放这些指针对象指向的空间,看源码在Dispose时调用了OnDestory方法了,能否提供默认的回调,我在回调里面处理

@2881099
Copy link
Owner

2881099 commented Apr 1, 2019

谢谢反馈!

目前我这边不直接使用 SafeObjectPool,因为每种资源对象的管理释放逻辑不一样。

参考实现:https://github.com/2881099/FreeSql/blob/master/FreeSql/PostgreSQL/PostgreSQLAdo/PostgreSQLConnectionPool.cs

@2881099
Copy link
Owner

2881099 commented Apr 1, 2019

比如可以参考实现 IntPtrPool 、IntPtrPoolPolicy 类

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants