Memory Leak in PropertyGrid when Rearranging Controls

オープン
#64 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
desktop

調査の方向性

提供された XAML と、アウトラインパネルでのドラッグ&ドロップ手順を使って Demo.XamlDesigner のリークを再現します。まず PropertyGrid.Reload と、それに関連する PropertyNode の保持を調査し、次に Reload をコメントアウトした場合のメモリ動作と比較します。繰り返し並べ替えてもプロセスメモリが増加しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hello,
I think I found a memory leak. Here are the steps to reproduce it on Demo.XamlDesigner:

  • run Demo.XamlDesigner app
  • in the XAML tab, paste the following code:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Width="640"
        Height="480">
  <Canvas>
    <TabControl Width="304"
                Height="167"
                Canvas.Left="72"
                Canvas.Top="132">
      <TabItem />
      <TabItem />
      <TabItem />
      <TabItem />
      <CheckBox />
    </TabControl>
    <CheckBox Canvas.Left="157" Canvas.Top="233.04000000000002" />
    <CheckBox Canvas.Left="242" Canvas.Top="208" />
    <CheckBox Canvas.Left="157" Canvas.Top="173.04000000000002" />
    <CheckBox Canvas.Left="234" Canvas.Top="158" />
    <CheckBox Canvas.Left="116" Canvas.Top="208" />
  </Canvas>
</Window>
  • switch to Design view
  • in the outline panel, drag and drop the tab items and check boxes onto each other randomly
  • see the process memory consumption increase

Here is the screen recording video of this process.

If you comment out the PropertyGrid.Reload method body, the problem seems to disappear. This this might be PropertyNode - related. However, I was unable to track down the object retention problem to fix it.

主要言語
C#
スター
1.1k
フォーク
281
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

icsharpcode/WpfDesigner のほかの issue

icsharpcode/WpfDesigner の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。