1.1 --- a/include/fsserver/accessor.h Sun Aug 16 01:21:34 2020 +0200
1.2 +++ b/include/fsserver/accessor.h Sun Aug 16 17:38:29 2020 +0200
1.3 @@ -105,13 +105,16 @@
1.4 virtual unsigned int detach()
1.5 {
1.6 lock_accessor();
1.7 - unsigned int result = --_attached;
1.8
1.9 - if (!result)
1.10 - finalise();
1.11 + if (_attached)
1.12 + {
1.13 + _attached--;
1.14 + if (!_attached)
1.15 + finalise();
1.16 + }
1.17
1.18 unlock_accessor();
1.19 - return result;
1.20 + return _attached;
1.21 }
1.22
1.23 virtual void initialise() { }