Maelstrom: Save the preferences to disk after closing a dialog, so I'm not confused when debugging. :)

https://github.com/libsdl-org/Maelstrom/commit/b7da8723260f04e21da3eda50a6779d1a615ba21

From b7da8723260f04e21da3eda50a6779d1a615ba21 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 7 Nov 2011 20:41:24 -0500
Subject: [PATCH] Save the preferences to disk after closing a dialog, so I'm
 not confused when debugging. :)

---
 screenlib/UIPanel.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/screenlib/UIPanel.cpp b/screenlib/UIPanel.cpp
index f586b4c8..77e308c9 100644
--- a/screenlib/UIPanel.cpp
+++ b/screenlib/UIPanel.cpp
@@ -113,7 +113,13 @@ UIPanel::Hide()
 
 	// Save data to preferences
 	if (ShouldSaveData()) {
-		SaveData(GetUI()->GetPrefs());
+		Prefs *prefs = GetUI()->GetPrefs();
+
+		// Save any data bindings to the preferences
+		SaveData(prefs);
+
+		// Save the preferences to disk (comment to just save at exit)
+		prefs->Save();
 	}
 
 	if (m_delegate) {