https://github.com/libsdl-org/Maelstrom/commit/b30a91130a633c042c3212e331c178034e5d867f
From b30a91130a633c042c3212e331c178034e5d867f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 18 Sep 2012 01:00:53 -0700
Subject: [PATCH] When an area is deleted, make sure there are no areas still
anchored to it.
---
screenlib/UIArea.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/screenlib/UIArea.cpp b/screenlib/UIArea.cpp
index d310a2ed..41304f1d 100644
--- a/screenlib/UIArea.cpp
+++ b/screenlib/UIArea.cpp
@@ -47,6 +47,9 @@ UIArea::~UIArea()
if (m_anchor.element) {
m_anchor.element->DelAnchoredArea(this);
}
+ for (int i = 0; i < m_anchoredAreas.length(); ++i) {
+ m_anchoredAreas[i]->SetAnchor(CENTER, CENTER, NULL);
+ }
}
bool