Microsoft MVP성태의 닷넷 이야기
글쓴 사람
전경호
홈페이지
첨부 파일
[WpfApp5.zip]    
(연관된 글이 1개 있습니다.)

WPF의 WindowsFormsHost의 메모리 누수 때문에 문의 드립니다.

Class1에

public class Class1 : WindowsFormsHost{
    public Class1()
    {
    }

    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
    }}

와 같이 WindowsFormsHost를 상속받아서 사용하려합니다.

이 때 윈도우를 하나 생성해서 해당 윈도우에 Class1을 사용하고

<Window
x:Class="WpfApp5.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp5"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Window1"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
    <local:Class1 Background="AliceBlue" />
</Grid>

위 윈도우를 버튼을 이용하여 계속 띄웠다 닫았다 띄웠다 닫았다 하면

메모리를 스냅샷을 찍으면 메모리가 띄운만큼 그대로 남아있습니다.

혹시 어떻게 해야 dispose가 제대로 될까요?


[연관 글]






[최초 등록일: ]
[최종 수정일: 9/22/2020]


비밀번호

댓글 작성자
 



2020-09-23 10시08분
WPF - WindowsFormsHost를 담은 윈도우 생성 시 메모리 누수
; https://www.sysnet.pe.kr/2/0/12340

정성태

1  2  3  4  [5]  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5828김재영2/19/20233141장기적으로는 this 구문을 안쓰는게 맞을까요? [2]
5827lee2/18/20233058파이썬 설치 오류 질문입니다 [1]
5826Syong2/14/20233639Socket 관련 Leak (OverlappedAsyncResult, OverlappedData) 관련 문의 [7]파일 다운로드1
5825박성원2/14/20233211Listview 컨트롤의 화면 전환 시 갱신 속도 [1]
5823검은콩2/13/20233811catch(Exception ex)의 line번호를 쉽게 알 수 없는지요? [7]
5822김지우2/11/20233085책을 보면서 sync, async 이해가 되지 않는 부분이 있습니다. [5]파일 다운로드2
5821검은콩2/9/20233112Async 신뢰성과 소켓데이터 [4]
5820차가워2/8/20233173다른 프로세스 실행 후 포커스 가져오기 [3]
5819취준생2/7/20233327WPF 관련 실무가 궁금합니다. [3]
5818윤길2/7/20232776ObservableCollection 에서 INotifyPropertyChanged 구현해야하나요? [2]
5817흰털너부리2/7/20232915배포 시 winform 실행 콘솔로그 보는 방법 [1]
5816흰털너부리2/6/20232726.net core json array validation 질문 드립니다. [1]
5815김재영2/6/20232850종단간 암호화에 대해 시나리오인데 타당한 시나리오일까요? [2]
5814한예지 donator2/6/20233184decompile? [9]
5813김재영2/5/20233079openssl genrsa 2048시 키 생성이 다르게 됩니다. - 파일첨부 [4]파일 다운로드1
5812김재영2/5/20233357openssl genrsa 2048시 키 생성이 다르게 됩니다. [2]
5811치르바2/3/20233187MiniDumpWriteDump API로 덤프수집을 했는데요.. [3]
5810이건우1/31/20233290윈도우서비스를 통한 웹통신관련 질문입니다 [3]
5809이상훈1/31/20233730다채널 영상 디스플레이어 개발 관련 질문입니다. [3]
5808근우1/30/20233407WPF 에서 UserControl 과 ControlTemplate 의 차이점은 무엇인가요? [6]
5807궁금맨1/28/20234564C# 10 책에 나온 예제의 결과가 제 컴에서는 좀 달라서요. 이유가 궁금합니다. [1]
5806스레드1/25/20233077총정리 - 다양한 스레드들 [초안] [1]파일 다운로드1
5805어웨이트1/25/20232940Taskcontinuewith vs Async/Await [2]파일 다운로드1
5804나이많은...1/25/20232798MS의 Dependency Injection(DI)에 AddSingleton으로 등록된 객체의 Event 등록후 사용시 앱 종료시 별도로 Event를 해지해야 하나요? [2]
5803dssc...1/24/20233030드라이브 문자를 통해서 물리 디스크 명칭을 알아내고 싶습니다. [1]
5802모바일앱1/22/20232920XAMARINE vs Android Studio [7]
1  2  3  4  [5]  6  7  8  9  10  11  12  13  14  15  ...