From 7e96f826c09cc49a52fe03c765141a8f295b1091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 20 Aug 2020 11:02:45 +0200 Subject: [PATCH] ksys/act: Fix ~ActorLinkConstDataAccess --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp index 476482ce..3eda6bcd 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp @@ -4,8 +4,11 @@ namespace ksys::act { ActorLinkConstDataAccess::~ActorLinkConstDataAccess() { - if (mAcquired) - acquire(nullptr); + if (mAcquired && mProc) + mProc->release(); + + mAcquired = false; + mProc = nullptr; } bool ActorLinkConstDataAccess::acquire(BaseProc* proc) {