diff options
author | Max Kellermann <max@duempel.org> | 2014-09-26 13:29:44 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-10-01 23:10:32 +0200 |
commit | 0661fd6f7c66ae888b6fc253af6dd0514798eff5 (patch) | |
tree | 9cc213a9d3be7709f937df4cfb40255d74146338 /src/lib/nfs/Cancellable.hxx | |
parent | edd003b62af802fae7828336628adb0ea3f6bd21 (diff) | |
download | mpd-0661fd6f7c66ae888b6fc253af6dd0514798eff5.tar.gz mpd-0661fd6f7c66ae888b6fc253af6dd0514798eff5.tar.xz mpd-0661fd6f7c66ae888b6fc253af6dd0514798eff5.zip |
lib/nfs/FileReader: postpone the nfs_close_async() call
If an async opertion is in progress, nfs_close_async() will make
libnfs crash because the RPC callback will dereference an object that
was freed by nfs_close_async().
Diffstat (limited to '')
-rw-r--r-- | src/lib/nfs/Cancellable.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/nfs/Cancellable.hxx b/src/lib/nfs/Cancellable.hxx index 1f287c329..be4527ac3 100644 --- a/src/lib/nfs/Cancellable.hxx +++ b/src/lib/nfs/Cancellable.hxx @@ -150,6 +150,13 @@ public: i->Cancel(); } + + CT &Get(reference_type p) { + auto i = Find(p); + assert(i != list.end()); + + return *i; + } }; #endif |