diff --git a/src/client/component/splash.cpp b/src/client/component/splash.cpp index b4a35a99..70208fd7 100644 --- a/src/client/component/splash.cpp +++ b/src/client/component/splash.cpp @@ -60,13 +60,15 @@ namespace splash this->destroy(); } - void hide() const + void hide() { if (this->window_ && IsWindow(this->window_)) { ShowWindow(this->window_, SW_HIDE); UpdateWindow(this->window_); } + + this->destroy(); } private: @@ -82,6 +84,7 @@ namespace splash ShowWindow(this->window_, SW_HIDE); DestroyWindow(this->window_); this->window_ = nullptr; + if (this->window_thread_.joinable()) { this->window_thread_.join(); @@ -89,6 +92,10 @@ namespace splash this->window_ = nullptr; } + else if (this->window_thread_.joinable()) + { + this->window_thread_.detach(); + } } void draw()