Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 1f01626

Browse files
authored
Getting all the dispose together for ease of viewing
1 parent e9d1f5a commit 1f01626

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/GitHub.UI.Reactive/Controls/ViewBase.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public class ViewBase<TInterface, TImplementor> : ViewBase, IView, IViewFor<TInt
105105
"ViewModel", typeof(TInterface), typeof(TImplementor), new PropertyMetadata(null));
106106

107107
IDisposable subscriptions;
108-
bool disposed;
109108

110109
/// <summary>
111110
/// Initializes a new instance of the <see cref="ViewBase{TInterface, TImplementor}"/> class.
@@ -148,14 +147,6 @@ public ViewBase()
148147
});
149148
}
150149

151-
/// <summary>
152-
/// The control finalizer.
153-
/// </summary>
154-
~ViewBase()
155-
{
156-
Dispose(false);
157-
}
158-
159150
/// <summary>
160151
/// Gets or sets the control's data context as a typed view model.
161152
/// </summary>
@@ -200,15 +191,7 @@ IViewModel IView.ViewModel
200191
get { return ViewModel; }
201192
}
202193

203-
/// <summary>
204-
/// Releases the managed resources held by the control.
205-
/// </summary>
206-
public void Dispose()
207-
{
208-
Dispose(true);
209-
GC.SuppressFinalize(this);
210-
}
211-
194+
bool disposed;
212195
/// <summary>
213196
/// Releases the managed or unmanaged resources held by the control.
214197
/// </summary>
@@ -225,5 +208,22 @@ protected virtual void Dispose(bool disposing)
225208
disposed = true;
226209
}
227210
}
211+
212+
/// <summary>
213+
/// The control finalizer.
214+
/// </summary>
215+
~ViewBase()
216+
{
217+
Dispose(false);
218+
}
219+
220+
/// <summary>
221+
/// Releases the managed resources held by the control.
222+
/// </summary>
223+
public void Dispose()
224+
{
225+
Dispose(true);
226+
GC.SuppressFinalize(this);
227+
}
228228
}
229229
}

0 commit comments

Comments
 (0)