From 56207fbf4e8662b6cf93632193ba68d2576c2d4e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 1 Apr 2026 12:07:58 +0100 Subject: Helper to instantiate transient static values as required --- gfx/renderable.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gfx') diff --git a/gfx/renderable.cpp b/gfx/renderable.cpp index 4597597..90035c3 100644 --- a/gfx/renderable.cpp +++ b/gfx/renderable.cpp @@ -2,6 +2,7 @@ #include "gl_traits.h" #include "location.h" #include "maths.h" +#include "util.h" std::weak_ptr Renderable::commonLocationData; @@ -21,9 +22,7 @@ Renderable::CommonLocation ::operator=(Location const & location) Renderable::Renderable() { - if (!(locationData = commonLocationData.lock())) { - commonLocationData = locationData = std::make_shared(); - } + createIfRequired(locationData, commonLocationData); } GLuint -- cgit v1.3