Cleaning pointers related code

This commit is contained in:
Loic Guegan 2022-12-31 20:45:03 +01:00
parent 21a5b3df8a
commit 8a14abe007
14 changed files with 63 additions and 63 deletions

View file

@ -30,7 +30,7 @@ EngineTab::EngineTab(wxWindow *parent, uciadapter::UCI *engine,
}
EngineTab::EngineTab(wxWindow *parent, std::string name)
: TabEngine(parent), TabInfos(TabInfos::ENGINE), engine(NULL) {
: TabEngine(parent), TabInfos(TabInfos::ENGINE), engine(nullptr) {
SetLabel(name);
engineName = name;
confGroup = "engines/" + engineName;
@ -45,7 +45,7 @@ EngineTab::EngineTab(wxWindow *parent, std::string name)
}
EngineTab::~EngineTab() {
if (engine != NULL) {
if (engine != nullptr) {
wxLogDebug("EngineTab destructor: destroying engine!");
engine->quit();
delete engine;

View file

@ -18,8 +18,8 @@ public:
EngineTab(wxWindow *parent, std::string name);
~EngineTab();
void ApplyPreferences() {}
std::shared_ptr<Game> GetGame() { return (std::shared_ptr<Game>(NULL)); }
std::shared_ptr<GameBase> GetBase() { return (std::shared_ptr<GameBase>(NULL)); }
std::shared_ptr<Game> GetGame() { return nullptr; }
std::shared_ptr<GameBase> GetBase() { return nullptr; }
void OnSave(wxCommandEvent &event);
void OnDelete(wxCommandEvent &event);
};