]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/persist.cpp
attempt to get the 'new focus' window parameter of a focus kill event set correctly
[wxWidgets.git] / src / common / persist.cpp
index 64b5957c7cd4fe89863dce0ae1a3f210e3d904db..4ca337cc0ccba07f770e8e749f32868f95747875 100644 (file)
 
 #include "wx/persist.h"
 
+namespace
+{
+
+wxPersistenceManager* gs_manager = NULL;
+
+} // anonymous namespace
+
 // ============================================================================
 // wxPersistenceManager implementation
 // ============================================================================
 
+/* static */
+void wxPersistenceManager::Set(wxPersistenceManager& manager)
+{
+    gs_manager = &manager;
+}
+
 /* static */
 wxPersistenceManager& wxPersistenceManager::Get()
 {
-    static wxPersistenceManager s_manager;
+    if ( !gs_manager )
+    {
+        static wxPersistenceManager s_manager;
+
+        gs_manager = &s_manager;
+    }
 
-    return s_manager;
+    return *gs_manager;
 }
 
 wxPersistenceManager::~wxPersistenceManager()
@@ -152,6 +170,6 @@ wxPERSIST_DEFINE_SAVE_RESTORE_FOR(int)
 wxPERSIST_DEFINE_SAVE_RESTORE_FOR(long)
 wxPERSIST_DEFINE_SAVE_RESTORE_FOR(wxString)
 
-#undef wxPERSIST_DEFINE_SAVE_RESTORE_FOR  
+#undef wxPERSIST_DEFINE_SAVE_RESTORE_FOR
 
 #endif // wxUSE_CONFIG