Skip to content

Commit

Permalink
DNET-421
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Mar 26, 2012
1 parent 607c9fa commit d00a37a
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -452,15 +452,19 @@ public void RemovePreparedCommand(FbCommand command)

public void ReleasePreparedCommands()
{
for (int i = 0; i < this.preparedCommands.Count; i++)
WeakReference[] toProcess = new WeakReference[this.preparedCommands.Count];
this.preparedCommands.CopyTo(toProcess);
for (int i = 0; i < toProcess.Length; i++)
{
if (!this.preparedCommands[i].IsAlive)
WeakReference current = toProcess[i];

if (!current.IsAlive)
continue;

try
{
// Release statement handle
(this.preparedCommands[i].Target as FbCommand).Release();
(current.Target as FbCommand).Release();
}
catch (System.IO.IOException)
{
Expand Down

0 comments on commit d00a37a

Please sign in to comment.