From d8757d017d6617fec191d04126858dfb92c089af Mon Sep 17 00:00:00 2001 From: gezimbll Date: Mon, 9 Jun 2025 15:39:35 +0200 Subject: [PATCH] using an temp variable for lkID in unlock method --- engine/libstats.go | 6 ++++-- engine/thresholds.go | 6 ++++-- resources/resources.go | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/engine/libstats.go b/engine/libstats.go index b11015ab1..e3070c00b 100644 --- a/engine/libstats.go +++ b/engine/libstats.go @@ -122,8 +122,9 @@ func (sqp *StatQueueProfile) unlock() { if sqp.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(sqp.lkID) + tmp := sqp.lkID sqp.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this StatQueueProfile @@ -275,8 +276,9 @@ func (sq *StatQueue) unlock() { if sq.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(sq.lkID) + tmp := sq.lkID sq.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this StatQueue diff --git a/engine/thresholds.go b/engine/thresholds.go index 60f6db2f3..7fda00e4e 100644 --- a/engine/thresholds.go +++ b/engine/thresholds.go @@ -113,8 +113,9 @@ func (tp *ThresholdProfile) unlock() { if tp.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(tp.lkID) + tmp := tp.lkID tp.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this ThresholdProfile @@ -192,8 +193,9 @@ func (t *Threshold) unlock() { if t.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(t.lkID) + tmp := t.lkID t.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this threshold diff --git a/resources/resources.go b/resources/resources.go index d6256398c..226ae707f 100644 --- a/resources/resources.go +++ b/resources/resources.go @@ -56,8 +56,9 @@ func (rp *resourceProfile) unlock() { if rp.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(rp.lkID) + tmp := rp.lkID rp.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this resourceProfile @@ -92,8 +93,9 @@ func (r *resource) unlock() { if r.lkID == utils.EmptyString { return } - guardian.Guardian.UnguardIDs(r.lkID) + tmp := r.lkID r.lkID = utils.EmptyString + guardian.Guardian.UnguardIDs(tmp) } // isLocked returns the locks status of this resource