WPF常见内存泄露
Event handlers leakThis type of leak occurs when subscribing an object (let‘s call it listener) to an event of some other object (let‘s call it source). For example:? ?Wpf binding leakBreaking WPF data binding patterns also can cause a memory leak. After you perform data binding to some property of a source object,the binding target object starts to listen for property change notifications. If the property is not a The leak will not take place in case the OneTime binding mode is used to update the target. ? ?Wpf collection binding leakThis leak is similar to the WPF binding leak described above. If there is binding to a collection that does not implement the? ?Dependency property leakThis leak occurs due to quite the same reasons as the event handlers leak. GC will not collect objects subscribed on ?x:Name WPF leakThis leak takes place because of the following WPF peculiarity: WPF creates a strong global reference to the UI element that is declared in XAML and uses the x:Name directive. For example: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |