Memory Leak in PropertyGrid when Rearranging Controls

Offen
#64 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
csharp
Bereich
desktop

Rechercherichtung

Reproduziere das Leak in Demo.XamlDesigner mit dem bereitgestellten XAML und den Drag-and-Drop-Schritten im Outline-Panel. Beginne mit der Untersuchung von PropertyGrid.Reload und der damit verbundenen Beibehaltung von PropertyNode, und vergleiche anschließend das Speicherverhalten mit auskommentiertem Reload; abgeschlossen ist die Aufgabe, wenn wiederholtes Umordnen nicht mehr dazu führt, dass der Prozessspeicher wächst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C#
Sterne
1.1k
Forks
281
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus icsharpcode/WpfDesigner

Alle Issues in icsharpcode/WpfDesigner

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.