From 2f966201cf397043756b5a54e23e987151ec0638 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Sep 2019 15:55:35 +0200 Subject: [PATCH] Make PerformanceManager crash no longer Replace `setPropertyValue` with `setPropertyValueSingle` in `property_helper` for better performance --- data/assets/util/property_helper.asset | 6 +++--- src/performance/performancemanager.cpp | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/data/assets/util/property_helper.asset b/data/assets/util/property_helper.asset index dab5038a2c..50feeeb5d3 100644 --- a/data/assets/util/property_helper.asset +++ b/data/assets/util/property_helper.asset @@ -1,14 +1,14 @@ -- Function that returns the string that inverts the fully qualified boolean property 'property' local invert = function(prop) local escaped_property = "'" .. prop .. "'" - return "openspace.setPropertyValue(" .. escaped_property .. ", not openspace.getPropertyValue(" .. escaped_property .. "));" + return "openspace.setPropertyValueSingle(" .. escaped_property .. ", not openspace.getPropertyValue(" .. escaped_property .. "));" end -- Function that returns the string that increments the 'property' by the 'value' local increment = function(prop, value) local v = value or 1 local escaped_property = "'" .. prop .. "'" - return "openspace.setPropertyValue(" .. escaped_property .. ", openspace.getPropertyValue(" .. escaped_property .. ") + " .. v .. ");" + return "openspace.setPropertyValueSingle(" .. escaped_property .. ", openspace.getPropertyValue(" .. escaped_property .. ") + " .. v .. ");" end -- Function that returns the string that decrements the 'property' by the 'value' @@ -21,7 +21,7 @@ local fade = function(prop, value, duration) assert(type(duration) == "number", "duration must be a number") local escaped_property = "'" .. prop .. "'" - return "openspace.setPropertyValue(" .. escaped_property ..", " .. tostring(value) .. ", " .. tostring(duration) .. ")" + return "openspace.setPropertyValueSingle(" .. escaped_property ..", " .. tostring(value) .. ", " .. tostring(duration) .. ")" end local fadeOut = function(prop, duration) diff --git a/src/performance/performancemanager.cpp b/src/performance/performancemanager.cpp index 6694af0fca..d752c049f1 100644 --- a/src/performance/performancemanager.cpp +++ b/src/performance/performancemanager.cpp @@ -69,8 +69,6 @@ void PerformanceManager::CreateGlobalSharedMemory() { "The global memory struct does not fit the allocated global memory space" ); - ghoul::SharedMemory::remove(GlobalSharedMemoryName); - if (ghoul::SharedMemory::exists(GlobalSharedMemoryName)) { ghoul::SharedMemory sharedMemory(GlobalSharedMemoryName); sharedMemory.acquireLock();