diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/RestClient.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index e556181..fb79c59 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Framework.Communications | |||
56 | /// other threads to execute, while it waits for a response from the web-service. RestClient itself can be | 56 | /// other threads to execute, while it waits for a response from the web-service. RestClient itself can be |
57 | /// invoked by the caller in either synchronous mode or asynchronous modes. | 57 | /// invoked by the caller in either synchronous mode or asynchronous modes. |
58 | /// </remarks> | 58 | /// </remarks> |
59 | public class RestClient | 59 | public class RestClient : IDisposable |
60 | { | 60 | { |
61 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 61 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
62 | 62 | ||
@@ -148,6 +148,33 @@ namespace OpenSim.Framework.Communications | |||
148 | 148 | ||
149 | #endregion constructors | 149 | #endregion constructors |
150 | 150 | ||
151 | |||
152 | #region Dispose | ||
153 | |||
154 | private bool disposed = false; | ||
155 | |||
156 | public void Dispose() | ||
157 | { | ||
158 | Dispose(true); | ||
159 | GC.SuppressFinalize(this); | ||
160 | } | ||
161 | |||
162 | protected virtual void Dispose(bool disposing) | ||
163 | { | ||
164 | if (disposed) | ||
165 | return; | ||
166 | |||
167 | if (disposing) | ||
168 | { | ||
169 | _resource.Dispose(); | ||
170 | } | ||
171 | |||
172 | disposed = true; | ||
173 | } | ||
174 | |||
175 | #endregion Dispose | ||
176 | |||
177 | |||
151 | /// <summary> | 178 | /// <summary> |
152 | /// Add a path element to the query, e.g. assets | 179 | /// Add a path element to the query, e.g. assets |
153 | /// </summary> | 180 | /// </summary> |