diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
commit | b916407a2a06f8452e82b74dc44c54acbcc572b0 (patch) | |
tree | 46358e0bb035fca0f42edb4b5b8aa5f1613814af /zen/privilege.cpp | |
parent | 5.20 (diff) | |
download | FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.gz FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.bz2 FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.zip |
5.21
Diffstat (limited to 'zen/privilege.cpp')
-rw-r--r-- | zen/privilege.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/zen/privilege.cpp b/zen/privilege.cpp index 44318517..d4f956a8 100644 --- a/zen/privilege.cpp +++ b/zen/privilege.cpp @@ -104,13 +104,15 @@ private: ~Privileges() //clean up: deactivate all privileges that have been activated by this application { - for (auto it = activePrivileges.begin(); it != activePrivileges.end(); ++it) - if (it->second) + for (const auto& priv : activePrivileges) + if (priv.second) + { try { - setPrivilege(it->first.c_str(), false); //throw FileError + setPrivilege(priv.first.c_str(), false); //throw FileError } - catch (...) {} + catch (FileError&) {} + } } std::map<Zstring, bool> activePrivileges; //bool: enabled by this application |