File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
NHibernate.Test/NHSpecificTest/Logs Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,17 @@ public void WillGetSessionIdFromSessionLogsConcurrent()
192
192
}
193
193
}
194
194
195
+ [ Test ]
196
+ public void WillCleanlyFailOnDoubleProcessDispose ( )
197
+ {
198
+ using ( var s = OpenSession ( ) )
199
+ {
200
+ var p = ( ( AbstractSessionImpl ) s ) . BeginProcess ( ) ;
201
+ p . Dispose ( ) ;
202
+ Assert . That ( ( ) => p . Dispose ( ) , Throws . TypeOf < ObjectDisposedException > ( ) ) ;
203
+ }
204
+ }
205
+
195
206
// IFixingRequired interface ensures the value is evaluated at log time rather than at log buffer flush time.
196
207
public class SessionIdCapturer : IFixingRequired
197
208
{
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ public ProcessHelper(AbstractSessionImpl session)
329
329
330
330
public void Dispose ( )
331
331
{
332
- _context . Dispose ( ) ;
332
+ _context ? . Dispose ( ) ;
333
333
_context = null ;
334
334
if ( _session == null )
335
335
throw new ObjectDisposedException ( "The session process helper has been disposed already" ) ;
You can’t perform that action at this time.
0 commit comments