Skip to content

Commit

Permalink
Allow disposing multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
SlowLogicBoy authored Jan 15, 2025
1 parent ad83f72 commit ed41bd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Eto/Widget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (Handler is IDisposable handler)
if (!IsDisposed && Handler is IDisposable handler)
handler.Dispose();
IsDisposed = true;
Handler = null;
Expand All @@ -560,4 +560,4 @@ public override string ToString()
else
return base.ToString();
}
}
}

0 comments on commit ed41bd7

Please sign in to comment.