From 0cd1258b6cc8aab3a0789a4e8f2860319932f799 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Sun, 21 Jul 2019 08:52:21 -0700 Subject: [PATCH] Move destructor to "Nuke". --- public/AutoHandleRooter.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/public/AutoHandleRooter.h b/public/AutoHandleRooter.h index 3c93699cc..eb5ecb622 100644 --- a/public/AutoHandleRooter.h +++ b/public/AutoHandleRooter.h @@ -110,18 +110,24 @@ public: ~AutoHandleIdentLocker() { - if (this->pSecurity) - this->pSecurity->access[HandleAccess_Delete] &= ~HANDLE_RESTRICT_IDENTEXCLUSIVE; - - this->pSecurity = nullptr; + this->Nuke(); } public: AutoHandleIdentLocker &operator =(const AutoHandleIdentLocker &other) { - ~AutoHandleIdentLocker(); + this->Nuke(); this->pSecurity = other.pSecurity; } +private: + void Nuke(void) + { + if (this->pSecurity) + { + this->pSecurity->access[HandleAccess_Delete] &= ~HANDLE_RESTRICT_IDENTEXCLUSIVE; + this->pSecurity = nullptr; + } + } private: HandleAccess *pSecurity; };