摘要:
最近这两天一直在忙着为一个项目检查内存泄漏(Memory Leak)的问题,对相关的知识进行了一下简单的学习和探索,其间也有了一些粗浅的经验积累,今天特意写一篇相关的文章与大家分享。那些对内存泄漏稍微有点了解的人,对于本篇文章的标题,相信不会觉得是在危言耸听。就我查阅的资料,已经这两天的发现也证实了这一点:觉得部分的内存泄漏问题与事件(Event)有关。本篇文章将会介绍其原理,以及如何发现和解决由事件导致的内存泄漏问题。 阅读全文
摘要:
As discussed last time, delegates can produce memory leaks in our applications if not used carefully. Most often, this happens with events when we add a handler to an event, forget to remove it and the object on which the event is declared lives longer than the object that handles it. The following diagram illustrates the problem. 阅读全文