Skip to content

Commit 444b6a0

Browse files
author
Arne Claassen
committed
Merge pull request #1 from legiar/master
Fixed dispose socket so that it only disposes if the socket isn't null
2 parents 17a2b5b + ffaff48 commit 444b6a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Beanstalk.Client/BeanstalkClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,14 @@ private void Dispose(bool suppressFinalizer) {
296296
if(suppressFinalizer) {
297297
GC.SuppressFinalize(this);
298298
}
299-
_socket.Dispose();
299+
if (_socket != null) {
300+
_socket.Dispose();
301+
}
300302
_disposed = true;
301303
}
302304

303305
~BeanstalkClient() {
304306
Dispose(false);
305307
}
306308
}
307-
}
309+
}

0 commit comments

Comments
 (0)