diff --git a/include/lock.hpp b/include/lock.hpp index aadd805..ed23deb 100644 --- a/include/lock.hpp +++ b/include/lock.hpp @@ -60,9 +60,9 @@ public: } ~SmartLockCriticalSectionClass() { + this->LockPointer->Unlock(); if (InterruptsEnabled) CPU::Interrupts(CPU::Enable); - this->LockPointer->Unlock(); } }; /** @brief Please use this macro to create a new critical section. */