diff --git a/src/main.cpp b/src/main.cpp index e064315..bd28e9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -85,11 +85,6 @@ const BYTE PixelShader[] = }; #endif -CMyAddon::CMyAddon() - : m_timer(nullptr) -{ -} - //////////////////////////////////////////////////////////////////////////// // Kodi tells us we should get ready to start rendering. This function // is called once when the screensaver is activated by Kodi. @@ -128,7 +123,7 @@ bool CMyAddon::Start() srand((u32)time(nullptr)); m_asteroids = std::make_unique(this); - m_timer = new CTimer(); + m_timer = std::make_unique(); m_timer->Init(); if (!m_asteroids->RestoreDevice()) { @@ -176,7 +171,6 @@ void CMyAddon::Stop() #endif m_asteroids->InvalidateDevice(); - SAFE_DELETE(m_timer); #ifndef WIN32 glBindBuffer(GL_ARRAY_BUFFER, 0); diff --git a/src/main.h b/src/main.h index c46b94a..561397f 100644 --- a/src/main.h +++ b/src/main.h @@ -49,7 +49,7 @@ class ATTR_DLL_LOCAL CMyAddon #endif { public: - CMyAddon(); + CMyAddon() = default; bool Start() override; void Stop() override; @@ -86,7 +86,7 @@ class ATTR_DLL_LOCAL CMyAddon #endif std::unique_ptr m_asteroids; - CTimer* m_timer; + std::unique_ptr m_timer; }; /***************************** I N L I N E S *******************************/