diff --git a/Enyim.Caching/Memcached/PooledSocket.cs b/Enyim.Caching/Memcached/PooledSocket.cs index e90c14d2..0113d19a 100755 --- a/Enyim.Caching/Memcached/PooledSocket.cs +++ b/Enyim.Caching/Memcached/PooledSocket.cs @@ -155,7 +155,16 @@ protected void Dispose(bool disposing) Action cc = this.CleanupCallback; if (cc != null) - cc(this); + { + try + { + cc(this); + } + catch (Exception e) + { + log.Info("CleanupCallback failed during Dispose. Ignoring the exception.", e); + } + } } } @@ -291,20 +300,20 @@ public bool ReceiveAsync(AsyncIOArgs p) #region [ License information ] /* ************************************************************ - * + * * Copyright (c) 2010 Attila Kiskó, enyim.com - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * ************************************************************/ #endregion