diff options
Diffstat (limited to 'StarsEx/GameWinDX9.cpp')
-rw-r--r-- | StarsEx/GameWinDX9.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/StarsEx/GameWinDX9.cpp b/StarsEx/GameWinDX9.cpp index 4b5b2d8..7099b90 100644 --- a/StarsEx/GameWinDX9.cpp +++ b/StarsEx/GameWinDX9.cpp @@ -24,7 +24,7 @@ #include "VideoSettings.h" -GameWinDX9* GameWinDX9::instance = nullptr; +GameWinDX9* GameWinDX9::instance {nullptr}; GameWinDX9* @@ -56,7 +56,7 @@ GameWinDX9::GameWinDX9() : is_device_restored {false} { if (instance != nullptr) - Panic::Panic("Multiple instances of GameWinDX9"); + throw "GameWinDX9 may have only one instance"; instance = this; video_settings = new VideoSettings; } @@ -64,13 +64,13 @@ GameWinDX9::GameWinDX9() : GameWinDX9::~GameWinDX9() { - if (instance != nullptr) - instance = nullptr; if (screen) delete screen; if (video_factory) delete video_factory; if (video) delete video; if (soundcard) delete soundcard; if (video_settings) delete video_settings; + if (instance == this) + instance = nullptr; } |