X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..e733c4ce1e24cf7e4b0b0d8362fc59aaa7a7641c:/src/common/persist.cpp diff --git a/src/common/persist.cpp b/src/common/persist.cpp index 7f8898f327..f1e951957f 100644 --- a/src/common/persist.cpp +++ b/src/common/persist.cpp @@ -3,7 +3,6 @@ // Purpose: common persistence support classes // Author: Vadim Zeitlin // Created: 2009-01-20 -// RCS-ID: $Id$ // Copyright: (c) 2009 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -30,16 +29,34 @@ #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()