From a195eb62688f18e4c1c3a77e837ab5a3c90e12c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Wed, 1 Apr 2020 02:39:55 +0200
Subject: [PATCH] Fix wrongly removed state blocks

---
 src/frame/frame_base.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/frame/frame_base.cpp b/src/frame/frame_base.cpp
index 34e36705f..85f94bd2a 100644
--- a/src/frame/frame_base.cpp
+++ b/src/frame/frame_base.cpp
@@ -140,7 +140,8 @@ void FrameBase::setNonEstimated()
 {
     // unregister if previously estimated
     if (isKeyOrAux())
-        removeStateBlocks(getProblem());
+        for (const auto& sb : getStateBlockVec())
+            getProblem()->notifyStateBlock(sb, REMOVE);
 
     type_ = NON_ESTIMATED;
     if (getTrajectory())
-- 
GitLab