[Tizen] Fix fontclient coverity issue 89/320089/1
authorBowon Ryu <bowon.ryu@samsung.com>
Thu, 20 Feb 2025 03:19:31 +0000 (12:19 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 24 Feb 2025 04:23:46 +0000 (13:23 +0900)
Change-Id: Ib2c0bfb1f863c49f978a0836e305e9cedddc3824
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali/internal/text/text-abstraction/font-client-impl.cpp

index 585154c7153bdbe986b347b0a57fdf179beb12e4..fbd97736e1fecd6e34319e9e08d2e57c860bfd91 100644 (file)
@@ -57,6 +57,8 @@ namespace TextAbstraction
 {
 namespace Internal
 {
+namespace
+{
 class FontThread
 {
 /*
@@ -66,9 +68,7 @@ class FontThread
  * by calling the join method in the destructor of this class.
  */
 public:
-  FontThread()
-  {
-  }
+  FontThread() = default;
   ~FontThread()
   {
     if(mThread.joinable())
@@ -76,27 +76,28 @@ public:
       mThread.join();
     }
   }
-  std::thread mThread;
+  std::thread mThread{};
 };
 
 std::string gLocale;     // The current language. (e.g., "en")
 std::string gLocaleFull; // The current locale identifier. (e.g., "en_US")
 
-Dali::TextAbstraction::FontClient FontClient::gPreCreatedFontClient(NULL);
-
-FontThread                        gPreCacheThread;
-FontThread                        gPreLoadThread;
+FontThread                        gPreCacheThread{};
+FontThread                        gPreLoadThread{};
 std::mutex                        gMutex;
 std::condition_variable           gPreCacheCond;
 std::condition_variable           gPreLoadCond;
-bool                              gPreCacheThreadReady;
-bool                              gPreLoadThreadReady;
+bool                              gPreCacheThreadReady = false;
+bool                              gPreLoadThreadReady = false;
 
 /* TODO: This is to prevent duplicate calls of font pre-cache.
  * We may support this later, but currently we can't guarantee the behaviour
  * if there is a pre-cache call from the user after the font client has been created. */
 bool gFontPreCacheAvailable = true;
 bool gFontPreLoadAvailable  = true;
+} // namespace
+
+Dali::TextAbstraction::FontClient FontClient::gPreCreatedFontClient(NULL);
 
 FontClient::FontClient()
 : mPlugin(nullptr),