From 9bfa8f1049ac039a83c829bd7b45cf26f4d46822 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 9 Dec 2016 16:14:16 +0100 Subject: [PATCH] Fixed: Release CCurrentCoTask singleton --- code/nel/include/nel/misc/co_task.h | 4 +++- code/nel/src/misc/co_task.cpp | 15 +++++++++++++++ code/ryzom/client/src/release.cpp | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/misc/co_task.h b/code/nel/include/nel/misc/co_task.h index bfd8f9ef0..80542834e 100644 --- a/code/nel/include/nel/misc/co_task.h +++ b/code/nel/include/nel/misc/co_task.h @@ -201,7 +201,9 @@ namespace NLMISC */ void sleep(uint milliseconds); - + /** Release internal instance. + */ + static void releaseInstance(); }; diff --git a/code/nel/src/misc/co_task.cpp b/code/nel/src/misc/co_task.cpp index 97a9e1e23..f817e3a5f 100644 --- a/code/nel/src/misc/co_task.cpp +++ b/code/nel/src/misc/co_task.cpp @@ -213,6 +213,16 @@ namespace NLMISC return _ThreadMainFiber.getPointer(); } #endif + + static void releaseInstance() + { + if (_Instance) + { + NLMISC::INelContext::getInstance().releaseSingletonPointer("CCurrentCoTask", _Instance); + delete _Instance; + _Instance = NULL; + } + } }; NLMISC_SAFE_SINGLETON_IMPL(CCurrentCoTask); @@ -560,5 +570,10 @@ namespace NLMISC } } + void CCoTask::releaseInstance() + { + CCurrentCoTask::releaseInstance(); + } + } // namespace NLMISC diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index 742a82edb..aac29d590 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -669,6 +669,7 @@ void release() CWidgetManager::release(); CViewRenderer::release(); CIXml::releaseLibXml(); + CCoTask::releaseInstance(); #if FINAL_VERSION // openURL ("http://www.ryzomcore.org/exit/");