mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-26 04:59:19 +00:00
Refactor hook.cpp
This commit is contained in:
@@ -33,10 +33,10 @@ template <class Func>
|
||||
class run_finally {
|
||||
DISALLOW_COPY_AND_MOVE(run_finally)
|
||||
public:
|
||||
explicit run_finally(const Func &fn) : fn(fn) {}
|
||||
explicit run_finally(Func &&fn) : fn(std::move(fn)) {}
|
||||
~run_finally() { fn(); }
|
||||
private:
|
||||
const Func &fn;
|
||||
Func fn;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user