Skip to content

Commit

Permalink
Add INotifyPropertyChanged to QuickClassBrowser.EntityItem.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Mar 19, 2011
1 parent d793900 commit d209e68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public partial class QuickClassBrowser : UserControl
/// <summary>
/// ViewModel used for combobox items.
/// </summary>
class EntityItem : IComparable<EntityItem>
class EntityItem : IComparable<EntityItem>, System.ComponentModel.INotifyPropertyChanged
{
IEntity entity;
IImage image;
Expand Down Expand Up @@ -96,6 +96,14 @@ public override string ToString()
{
return text;
}

// I'm not sure if it actually was a leak or caused by something else, but I saw QCB.EntityItem being alive for longer
// than it should when looking at the heap with WinDbg.
// Maybe this was caused by http://support.microsoft.com/kb/938416/en-us, so I'm adding INotifyPropertyChanged to be sure.
event System.ComponentModel.PropertyChangedEventHandler System.ComponentModel.INotifyPropertyChanged.PropertyChanged {
add { }
remove { }
}
}

public QuickClassBrowser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ void versionInfoTextBox_KeyDown(object sender, KeyEventArgs e)
#if DEBUG
if (e.KeyData == (Keys.Control | Keys.Shift | Keys.E)) {
throw new ClownFishException();
} else if (e.KeyData == (Keys.Control | Keys.Shift | Keys.G)) {
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
GC.WaitForPendingFinalizers();
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
versionInfoTextBox.Text = GetVersionInformationString();
}
#endif
}
Expand Down

0 comments on commit d209e68

Please sign in to comment.