From: <cin...@us...> - 2012-03-26 08:19:19
|
Revision: 54246 http://firebird.svn.sourceforge.net/firebird/?rev=54246&view=rev Author: cincura_net Date: 2012-03-26 08:19:13 +0000 (Mon, 26 Mar 2012) Log Message: ----------- DNET-421 Modified Paths: -------------- NETProvider/trunk/NETProvider/source/FirebirdSql/Data/FirebirdClient/FbConnectionInternal.cs Modified: NETProvider/trunk/NETProvider/source/FirebirdSql/Data/FirebirdClient/FbConnectionInternal.cs =================================================================== --- NETProvider/trunk/NETProvider/source/FirebirdSql/Data/FirebirdClient/FbConnectionInternal.cs 2012-03-26 07:55:25 UTC (rev 54245) +++ NETProvider/trunk/NETProvider/source/FirebirdSql/Data/FirebirdClient/FbConnectionInternal.cs 2012-03-26 08:19:13 UTC (rev 54246) @@ -452,15 +452,19 @@ 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) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |