Commit 2c0a9687 authored by Max Kellermann's avatar Max Kellermann

storage/smbclient: use std::lock_guard

parent 84c406d5
...@@ -59,9 +59,8 @@ public: ...@@ -59,9 +59,8 @@ public:
:base(_base), ctx(_ctx) {} :base(_base), ctx(_ctx) {}
virtual ~SmbclientStorage() { virtual ~SmbclientStorage() {
smbclient_mutex.lock(); const std::lock_guard<Mutex> lock(smbclient_mutex);
smbc_free_context(ctx, 1); smbc_free_context(ctx, 1);
smbclient_mutex.unlock();
} }
/* virtual methods from class Storage */ /* virtual methods from class Storage */
...@@ -153,9 +152,8 @@ SkipNameFS(const char *name) noexcept ...@@ -153,9 +152,8 @@ SkipNameFS(const char *name) noexcept
SmbclientDirectoryReader::~SmbclientDirectoryReader() SmbclientDirectoryReader::~SmbclientDirectoryReader()
{ {
smbclient_mutex.lock(); const std::lock_guard<Mutex> lock(smbclient_mutex);
smbc_close(handle); smbc_close(handle);
smbclient_mutex.unlock();
} }
const char * const char *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment