Browse Source

Workaround fix for layout updates completely locking out

Michael 8 years ago
parent
commit
079d3abc3e
1 changed files with 11 additions and 0 deletions
  1. 11 0
      Source/Core/Context.cpp

+ 11 - 0
Source/Core/Context.cpp

@@ -135,6 +135,17 @@ const Vector2i& Context::GetDimensions() const
 // Updates all elements in the element tree.
 // Updates all elements in the element tree.
 bool Context::Update()
 bool Context::Update()
 {
 {
+	// Reset all document layout locks (work-around due to leak, possibly in select element?)
+	for (int i = 0; i < root->GetNumChildren(); ++i)
+	{
+		ElementDocument* document = root->GetChild(i)->GetOwnerDocument();
+		if (document != NULL && document->lock_layout != 0)
+		{
+			Log::Message(Log::LT_WARNING, "Layout lock leak. Document '%s' had lock layout value: %d", document->title.CString(), document->lock_layout);
+			document->lock_layout = 0;
+		}
+	}
+
 	root->Update();
 	root->Update();
 
 
 	// Release any documents that were unloaded during the update.
 	// Release any documents that were unloaded during the update.