Skip to content

Commit

Permalink
Remove debugging code from production
Browse files Browse the repository at this point in the history
  • Loading branch information
Fitzchak Yitzchaki committed Apr 3, 2012
1 parent a86a4e4 commit 49196e5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Raven.Client.Lightweight/Document/DocumentStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using Raven.Abstractions.Connection;
Expand Down Expand Up @@ -233,7 +232,10 @@ protected virtual RavenConnectionStringOptions GetConnectionStringOptions()
/// </summary>
public override void Dispose()
{
#if DEBUG
GC.SuppressFinalize(this);
#endif

if (jsonRequestFactory != null)
jsonRequestFactory.Dispose();
#if !SILVERLIGHT
Expand All @@ -248,13 +250,15 @@ public override void Dispose()
afterDispose(this, EventArgs.Empty);
}

private readonly StackTrace e = new StackTrace();
#if DEBUG
private readonly System.Diagnostics.StackTrace e = new System.Diagnostics.StackTrace();
~DocumentStore()
{
var buffer = e.ToString();
var stacktraceDebug = string.Format("StackTrace recorded.{0}{1}{0}{0}", Environment.NewLine, buffer);
var stacktraceDebug = string.Format("StackTrace of un-disposed document store recorded. Please make sure to dispose any document store in the tests in order to avoid race conditions in tests.{0}{1}{0}{0}", Environment.NewLine, buffer);
Console.WriteLine(stacktraceDebug);
}
#endif

#if !SILVERLIGHT

Expand Down

0 comments on commit 49196e5

Please sign in to comment.