Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Prevent the common error condition when users call Dispose inside Fin…
Browse files Browse the repository at this point in the history
…ishedPlaying
  • Loading branch information
migueldeicaza committed Jul 28, 2011
1 parent dd85750 commit 291762e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AVFoundation/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public override void FinishedPlaying (AVAudioPlayer player, bool flag)
{
if (cbFinishedPlaying != null)
cbFinishedPlaying (player, new AVStatusEventArgs (flag));
if (player.Handle == IntPtr.Zero)
throw new ObjectDisposedException ("the player object was Dispose()d during the callback, this has corrupted the state of the program");
}

[Preserve (Conditional = true)]
Expand Down

0 comments on commit 291762e

Please sign in to comment.