From 2b36e1a6f6a1f246d411a06c60890804359a24df Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 29 Jul 2014 19:57:08 +0100 Subject: [PATCH] More effc++ fixing --- source/backend/engine/CarlaEngineInternal.cpp | 23 ++++++++++++++----- source/backend/engine/CarlaEngineInternal.hpp | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/source/backend/engine/CarlaEngineInternal.cpp b/source/backend/engine/CarlaEngineInternal.cpp index 4c6f0e60c..a205d8e4f 100644 --- a/source/backend/engine/CarlaEngineInternal.cpp +++ b/source/backend/engine/CarlaEngineInternal.cpp @@ -67,7 +67,8 @@ EngineInternalTime::EngineInternalTime() noexcept EngineNextAction::EngineNextAction() noexcept : opcode(kEnginePostActionNull), pluginId(0), - value(0) {} + value(0), + waitEvent() {} EngineNextAction::~EngineNextAction() noexcept { @@ -97,15 +98,25 @@ CarlaEngine::ProtectedData::ProtectedData(CarlaEngine* const engine) noexcept isIdling(0), curPluginCount(0), maxPluginNumber(0), -#ifndef BUILD_BRIDGE nextPluginId(0), - plugins(nullptr) {} -#else - nextPluginId(0) + lastError(), + name(), + options(), + timeInfo(), +#ifndef BUILD_BRIDGE + plugins(nullptr), +#endif + events(), +#ifndef BUILD_BRIDGE + graph(), +#endif + time(), + nextAction() { +#ifdef BUILD_BRIDGE carla_zeroStruct(plugins, 1); -} #endif +} CarlaEngine::ProtectedData::~ProtectedData() noexcept { diff --git a/source/backend/engine/CarlaEngineInternal.hpp b/source/backend/engine/CarlaEngineInternal.hpp index 2c9595f2c..f9f7852b1 100644 --- a/source/backend/engine/CarlaEngineInternal.hpp +++ b/source/backend/engine/CarlaEngineInternal.hpp @@ -26,6 +26,9 @@ using juce::Atomic; using juce::WaitableEvent; +// FIXME only use CARLA_PREVENT_HEAP_ALLOCATION for structs +// maybe separate macro + CARLA_BACKEND_START_NAMESPACE // ----------------------------------------------------------------------- @@ -87,6 +90,7 @@ private: PatchbayGraph* fPatchbay; }; + CARLA_PREVENT_HEAP_ALLOCATION CARLA_DECLARE_NON_COPY_STRUCT(EngineInternalGraph) }; #endif