Skip to content

Commit

Permalink
Replace ApplicationData singleton lifetime management macro calls
Browse files Browse the repository at this point in the history
Simply call the functions directly, there is no benefit to hide these
behind these macros.
  • Loading branch information
sodevel committed May 28, 2024
1 parent c56b6ed commit ddfee70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/maingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int MyApp::OnRun()

// Create singleton AppData - wait to initialize until sure that this is not the second
// instance of a project file.
AppDataCreate(dataDir);
ApplicationData::Get(dataDir);

// Make passed project name absolute
try {
Expand Down Expand Up @@ -207,7 +207,7 @@ int MyApp::OnRun()

// Init AppData
try {
AppDataInit();
ApplicationData::Initialize();
} catch (wxFBException& ex) {
wxLogError(_("Error loading application: %s\nwxFormBuilder cannot continue."), ex.what());
wxLog::FlushActive();
Expand Down Expand Up @@ -307,7 +307,7 @@ bool MyApp::OnInit()
int MyApp::OnExit()
{
MacroDictionary::Destroy();
AppDataDestroy();
ApplicationData::Destroy();

if (!wxTheClipboard->IsOpened()) {
if (!wxTheClipboard->Open()) {
Expand Down
3 changes: 0 additions & 3 deletions src/rad/appdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class wxFBManager;


#define AppData() (ApplicationData::Get())
#define AppDataCreate(path) (ApplicationData::Get(path))
#define AppDataInit() (ApplicationData::Initialize())
#define AppDataDestroy() (ApplicationData::Destroy())


// This class is a singleton class.
Expand Down

0 comments on commit ddfee70

Please sign in to comment.