projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that global variables are initialized lazily.
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
update
/
render-tasks
/
scene-graph-camera.cpp
diff --git
a/dali/internal/update/render-tasks/scene-graph-camera.cpp
b/dali/internal/update/render-tasks/scene-graph-camera.cpp
index
586d7cc
..
2322c4a
100644
(file)
--- a/
dali/internal/update/render-tasks/scene-graph-camera.cpp
+++ b/
dali/internal/update/render-tasks/scene-graph-camera.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
2
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
3
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-48,7
+48,11
@@
namespace SceneGraph
namespace
{
//Memory pool used to allocate new camera. Memory used by this pool will be released when shutting down DALi
namespace
{
//Memory pool used to allocate new camera. Memory used by this pool will be released when shutting down DALi
-MemoryPoolObjectAllocator<Camera> gCameraMemoryPool;
+MemoryPoolObjectAllocator<Camera>& GetCameraMemoryPool()
+{
+ static MemoryPoolObjectAllocator<Camera> gCameraMemoryPool;
+ return gCameraMemoryPool;
+}
template<typename T>
T Sign(T value)
template<typename T>
T Sign(T value)
@@
-205,14
+209,14
@@
Camera::Camera()
Camera* Camera::New()
{
Camera* Camera::New()
{
- return new(
gCameraMemoryPool
.AllocateRawThreadSafe()) Camera();
+ return new(
GetCameraMemoryPool()
.AllocateRawThreadSafe()) Camera();
}
Camera::~Camera() = default;
void Camera::operator delete(void* ptr)
{
}
Camera::~Camera() = default;
void Camera::operator delete(void* ptr)
{
-
gCameraMemoryPool
.FreeThreadSafe(static_cast<Camera*>(ptr));
+
GetCameraMemoryPool()
.FreeThreadSafe(static_cast<Camera*>(ptr));
}
void Camera::SetType(Dali::Camera::Type type)
}
void Camera::SetType(Dali::Camera::Type type)