Skip to content

Commit

Permalink
Merge pull request #2722 from SlowLogicBoy/patch-1
Browse files Browse the repository at this point in the history
Allow disposing multiple times
  • Loading branch information
cwensley authored Jan 15, 2025
2 parents ad83f72 + ed41bd7 commit 5545a4d
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 5545a4d

Please sign in to comment.