mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
dealt with Removed
This commit is contained in:
@@ -508,7 +508,6 @@ namespace Terminal.Gui {
|
||||
CurrentView = null;
|
||||
Top = null;
|
||||
|
||||
|
||||
// Closes the application if it's true.
|
||||
if (closeDriver) {
|
||||
MainLoop = null;
|
||||
|
||||
@@ -246,8 +246,6 @@ namespace Terminal.Gui {
|
||||
GC.SuppressFinalize (this);
|
||||
#if DEBUG_IDISPOSABLE
|
||||
WasDisposed = true;
|
||||
//Debug.Assert (DisposedCount == 0);
|
||||
//DisposedCount++;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1738,7 +1738,9 @@ namespace Terminal.Gui {
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
foreach (var subview in InternalSubviews) {
|
||||
for (int i = InternalSubviews.Count - 1; i >= 0; i--) {
|
||||
View subview = InternalSubviews [i];
|
||||
Remove (subview);
|
||||
subview.Dispose ();
|
||||
}
|
||||
base.Dispose (disposing);
|
||||
|
||||
@@ -1069,6 +1069,7 @@ namespace Terminal.Gui {
|
||||
if (mi.IsTopLevel) {
|
||||
var menu = new Menu (this, i, 0, mi);
|
||||
menu.Run (mi.Action);
|
||||
menu.Dispose ();
|
||||
} else {
|
||||
openedByHotKey = true;
|
||||
Application.GrabMouse (this);
|
||||
@@ -1176,6 +1177,7 @@ namespace Terminal.Gui {
|
||||
if (Menus [i].IsTopLevel) {
|
||||
var menu = new Menu (this, i, 0, Menus [i]);
|
||||
menu.Run (Menus [i].Action);
|
||||
menu.Dispose ();
|
||||
}
|
||||
} else if (me.Flags == MouseFlags.Button1Pressed || me.Flags == MouseFlags.Button1DoubleClicked || me.Flags == MouseFlags.Button1TripleClicked) {
|
||||
if (IsMenuOpen) {
|
||||
|
||||
@@ -35,5 +35,12 @@ namespace Terminal.Gui {
|
||||
Assert.False (r.OnEnter (new View ()));
|
||||
Assert.False (r.OnLeave (new View ()));
|
||||
}
|
||||
|
||||
// Generic lifetime (IDisposable) tests
|
||||
[Fact]
|
||||
public void Dispose_Works ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Terminal.Gui {
|
||||
List<Type> scenarioClasses = Scenario.GetDerivedClasses<Scenario> ();
|
||||
Assert.NotEmpty (scenarioClasses);
|
||||
|
||||
var item = scenarioClasses.FindIndex (t => Scenario.ScenarioMetadata.GetName (t).Equals ("Clipping", StringComparison.OrdinalIgnoreCase));
|
||||
var item = scenarioClasses.FindIndex (t => Scenario.ScenarioMetadata.GetName (t).Equals ("Generic", StringComparison.OrdinalIgnoreCase));
|
||||
var scenarioClass = scenarioClasses[item];
|
||||
// Setup some fake kepresses
|
||||
// Passing empty string will cause just a ctrl-q to be fired
|
||||
|
||||
Reference in New Issue
Block a user