We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
这几天做了一次大规模的代码重构,主要是试图解决 dp2OPAC 的内存泄漏问题。
最终发现是 DigitalPlatform.LibraryClient 库中的 LibraryChannel 在通讯中等待服务器返回结果的循环中,使用了 Windows Form 下才能使用的 Application.DoEvents(),造成了 thread handle 和 ReaderWriterLock 泄露,这可能是 Application.DoEvents() 内部的代码造成的现象。
为此,修改了对 Idle 事件的使用方法,让默认情况下不出现任何对 Application.Events() 的调用。仅当 Windows Form 程序需要的时候才主动通过 Idle 事件添加这种功能。
另外,对 dp2OPAC 中所有使用 LibraryChannel 的地方,都采用 ChannelPool 来管理。不过还余下 CacheBuilder 类里面的 LibraryChannel 用法等待改造。
对全部代码中包含 AutoResetEvent 和 ManulResetEvent 的类都确保具有 IDisposeable 接口,并注意这些对象的生存周期管理。
有些担心这些修改,会令 dp2OPAC 在 SSO 情况下的功能出现 bug,需要后面补上测试。
The text was updated successfully, but these errors were encountered:
Merge pull request #13 from DigitalPlatform/master
aea4b97
同步源
5414767
继续完成 RFID 函数库
No branches or pull requests
这几天做了一次大规模的代码重构,主要是试图解决 dp2OPAC 的内存泄漏问题。
最终发现是 DigitalPlatform.LibraryClient 库中的 LibraryChannel 在通讯中等待服务器返回结果的循环中,使用了 Windows Form 下才能使用的 Application.DoEvents(),造成了 thread handle 和 ReaderWriterLock 泄露,这可能是 Application.DoEvents() 内部的代码造成的现象。
为此,修改了对 Idle 事件的使用方法,让默认情况下不出现任何对 Application.Events() 的调用。仅当 Windows Form 程序需要的时候才主动通过 Idle 事件添加这种功能。
另外,对 dp2OPAC 中所有使用 LibraryChannel 的地方,都采用 ChannelPool 来管理。不过还余下 CacheBuilder 类里面的 LibraryChannel 用法等待改造。
对全部代码中包含 AutoResetEvent 和 ManulResetEvent 的类都确保具有 IDisposeable 接口,并注意这些对象的生存周期管理。
有些担心这些修改,会令 dp2OPAC 在 SSO 情况下的功能出现 bug,需要后面补上测试。
The text was updated successfully, but these errors were encountered: