diff --git a/.github/workflows/ecode-nightly.yml b/.github/workflows/ecode-nightly.yml index a66d10694..1fb9ac849 100644 --- a/.github/workflows/ecode-nightly.yml +++ b/.github/workflows/ecode-nightly.yml @@ -18,7 +18,7 @@ jobs: version: ${{ steps.tag.outputs.version }} steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Set Tag id: tag @@ -63,7 +63,7 @@ jobs: apt-get update apt-get install -y --no-install-recommends software-properties-common build-essential git ca-certificates - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive', set-safe-directory: true } - name: Set Environment Variables run: | @@ -122,7 +122,7 @@ jobs: CXX: g++ steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Set Environment Variables run: | @@ -182,7 +182,7 @@ jobs: CXX: g++ steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Set Environment Variables run: | @@ -232,7 +232,7 @@ jobs: runs-on: ${{ matrix.config.container }} steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Set Environment Variables run: | @@ -278,7 +278,7 @@ jobs: MACOS_TEAM_ID: ${{ secrets.MACOS_TEAM_ID }} steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: System Information run: | @@ -338,7 +338,7 @@ jobs: MACOS_TEAM_ID: ${{ secrets.MACOS_TEAM_ID }} steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: System Information run: | @@ -391,7 +391,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Set Environment Variables run: | @@ -431,7 +431,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Set Environment Variables run: | @@ -472,7 +472,7 @@ jobs: run: | git config --system core.autocrlf false - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Build shell: pwsh @@ -501,7 +501,7 @@ jobs: run: | git config --system core.autocrlf false - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: { fetch-depth: 0, submodules: 'recursive' } - name: Build shell: pwsh diff --git a/.github/workflows/eepp-android-build-check.yml b/.github/workflows/eepp-android-build-check.yml index 7432adee5..ce8a4205f 100644 --- a/.github/workflows/eepp-android-build-check.yml +++ b/.github/workflows/eepp-android-build-check.yml @@ -6,7 +6,7 @@ jobs: Android: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: recursive - uses: actions/setup-java@v4 diff --git a/.github/workflows/eepp-ios-build-check.yml b/.github/workflows/eepp-ios-build-check.yml index bef241821..3c932b5ec 100644 --- a/.github/workflows/eepp-ios-build-check.yml +++ b/.github/workflows/eepp-ios-build-check.yml @@ -6,7 +6,7 @@ jobs: iOS: runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: recursive - name: Install dependencies diff --git a/.github/workflows/eepp-linux-build-check.yml b/.github/workflows/eepp-linux-build-check.yml index 426ff1372..d9e628a65 100644 --- a/.github/workflows/eepp-linux-build-check.yml +++ b/.github/workflows/eepp-linux-build-check.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 with: ref: ${{ github.ref }} fetch-depth: 2 diff --git a/.github/workflows/eepp-macos-build-check.yml b/.github/workflows/eepp-macos-build-check.yml index f3ba3b148..462c0c98c 100644 --- a/.github/workflows/eepp-macos-build-check.yml +++ b/.github/workflows/eepp-macos-build-check.yml @@ -7,7 +7,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 with: ref: ${{ github.ref }} fetch-depth: 2 diff --git a/.github/workflows/eepp-windows-build-check.yml b/.github/workflows/eepp-windows-build-check.yml index 070ec1eed..a2bd56246 100644 --- a/.github/workflows/eepp-windows-build-check.yml +++ b/.github/workflows/eepp-windows-build-check.yml @@ -13,7 +13,7 @@ jobs: run: | git config --system core.autocrlf false - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 with: ref: ${{ github.ref }} fetch-depth: 2 diff --git a/include/eepp/scene/scenemanager.hpp b/include/eepp/scene/scenemanager.hpp index bdb02de4b..68471dcc0 100644 --- a/include/eepp/scene/scenemanager.hpp +++ b/include/eepp/scene/scenemanager.hpp @@ -37,8 +37,6 @@ class EE_API SceneManager { void update(); - bool isShuttingDown() const; - UISceneNode* getUISceneNode(); void setCurrentUISceneNode( UISceneNode* uiSceneNode ); @@ -48,7 +46,6 @@ class EE_API SceneManager { protected: Clock mClock; UISceneNode* mUISceneNode; - bool mIsShuttingDown; std::vector mSceneNodes; }; diff --git a/include/eepp/system/singleton.hpp b/include/eepp/system/singleton.hpp index c450f78da..663ec457b 100644 --- a/include/eepp/system/singleton.hpp +++ b/include/eepp/system/singleton.hpp @@ -13,6 +13,8 @@ static T* createSingleton(); \ \ static T* existsSingleton(); \ + \ + static bool isShuttingDown(); \ \ static T* instance(); \ \ @@ -23,6 +25,7 @@ #define SINGLETON_DECLARE_IMPLEMENTATION( T ) \ \ static T* ms_singleton = NULL; \ + static bool ms_is_shutting_down = false; \ static Mutex ms_mutex; \ \ T* T::createSingleton() { \ @@ -34,6 +37,10 @@ \ T* T::existsSingleton() { \ return ms_singleton; \ + } \ + \ + bool T::isShuttingDown() { \ + return ms_is_shutting_down; \ } \ \ T* T::instance() { \ @@ -41,8 +48,10 @@ } \ \ void T::destroySingleton() { \ + ms_is_shutting_down = true; \ Lock l( ms_mutex ); \ eeSAFE_DELETE( ms_singleton ); \ + ms_is_shutting_down = false; \ } \ \ void T::detachSingleton() { \ diff --git a/src/eepp/scene/scenemanager.cpp b/src/eepp/scene/scenemanager.cpp index e9c6bb97b..d1062213e 100644 --- a/src/eepp/scene/scenemanager.cpp +++ b/src/eepp/scene/scenemanager.cpp @@ -9,15 +9,13 @@ namespace EE { namespace Scene { SINGLETON_DECLARE_IMPLEMENTATION( SceneManager ) bool SceneManager::isActive() { - return EE::Window::Engine::isEngineRunning() && SceneManager::existsSingleton() && - !SceneManager::instance()->isShuttingDown(); + return Engine::isEngineRunning() && SceneManager::existsSingleton() && + !SceneManager::isShuttingDown(); } -SceneManager::SceneManager() : mUISceneNode( NULL ), mIsShuttingDown( false ) {} +SceneManager::SceneManager() : mUISceneNode( NULL ) {} SceneManager::~SceneManager() { - mIsShuttingDown = true; - for ( auto& it : mSceneNodes ) { SceneNode* node = it; eeSAFE_DELETE( node ); @@ -60,10 +58,6 @@ void SceneManager::update() { update( mClock.getElapsedTimeAndReset() ); } -bool SceneManager::isShuttingDown() const { - return mIsShuttingDown; -} - UISceneNode* SceneManager::getUISceneNode() { if ( NULL == mUISceneNode ) { for ( auto& sceneNode : mSceneNodes ) { diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 6b965974d..f4ede1588 100644 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -245,7 +245,7 @@ Uint32 Engine::getWindowCount() const { } bool Engine::isEngineRunning() { - return existsSingleton() && Engine::instance()->isRunning(); + return existsSingleton() && !isShuttingDown() && Engine::instance()->isRunning(); } bool Engine::isRunning() const {