From 2ee6ec29fe3e940f7675620629d5a5b1237ab83f Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Sat, 7 Jul 2018 11:03:03 +0800 Subject: [PATCH] =?UTF-8?q?GC=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Base/GC.cpp | 2 +- core/Base/Game.cpp | 4 +--- core/e2dbase.h | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/Base/GC.cpp b/core/Base/GC.cpp index b1b66989..3b433f20 100644 --- a/core/Base/GC.cpp +++ b/core/Base/GC.cpp @@ -61,7 +61,7 @@ e2d::GC::~GC() } -void e2d::GC::update() +void e2d::GC::flush() { if (!_instance._notifyed) return; diff --git a/core/Base/Game.cpp b/core/Base/Game.cpp index 76a14f0d..9e10641b 100644 --- a/core/Base/Game.cpp +++ b/core/Base/Game.cpp @@ -77,7 +77,7 @@ void e2d::Game::start(bool cleanup) actionManager->update(); // 更新动作管理器 sceneManager->update(); // 更新场景内容 renderer->render(); // 渲染游戏画面 - GC::update(); // 刷新内存池 + GC::flush(); // 刷新内存池 Time::__updateLast(); // 刷新时间信息 } @@ -87,8 +87,6 @@ void e2d::Game::start(bool cleanup) } } - _ended = true; - if (cleanup) { Game::cleanup(); diff --git a/core/e2dbase.h b/core/e2dbase.h index 12f652a5..ffe95c88 100644 --- a/core/e2dbase.h +++ b/core/e2dbase.h @@ -549,10 +549,10 @@ public: } } - // 更新垃圾回收器状态 - static void update(); + // 刷新内存池 + static void flush(); - // 清空所有对象 + // 回收内存池中的所有对象 static void clear(); private: