Skip to content

Commit

Permalink
Fix WindowManager and Logger singletons initializing
Browse files Browse the repository at this point in the history
  • Loading branch information
MahBoiDeveloper committed Jul 23, 2024
1 parent a8108ff commit 00bcb18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/GUI/WindowManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class WindowManager final
inline static QTranslator* pAppTranslator = nullptr;
QString WindowName;
public:
inline static std::unique_ptr<WindowManager> Instance = nullptr;
inline const static std::unique_ptr<WindowManager> Instance = std::make_unique<WindowManager>();

public: // Methods
WindowManager();
Expand Down
2 changes: 1 addition & 1 deletion src/Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Logger final
{
public: // Data
static inline std::unique_ptr<Logger> Instance;
inline const static std::unique_ptr<Logger> Instance = std::make_unique<Logger>();
private:
std::ofstream LogFile;

Expand Down
4 changes: 1 addition & 3 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ int main(int argc, char *argv[])
QApplication HotkeyEditor(argc, argv);

// Define logger as a singleton class, that could be used anywhere in project
Logger::Instance = make_unique<Logger>();
WindowManager::Instance = make_unique<WindowManager>();
CSFParser::Instance = make_unique<CSFParser>(Config::RESOURCE_FOLDER + "/DataSamples/generalsRU.csf");
CSFParser::Instance = make_unique<CSFParser>(Config::RESOURCE_FOLDER + "/DataSamples/generalsRU.csf");

try
{
Expand Down

0 comments on commit 00bcb18

Please sign in to comment.