From 981c332873ac4d101ebcbc83488ee87fc8d3e03a Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 29 Jul 2014 20:53:11 +0100 Subject: [PATCH] More --- source/backend/engine/CarlaEngineOsc.cpp | 9 ++++++++- source/backend/engine/CarlaEngineOsc.hpp | 9 ++++----- source/backend/engine/CarlaEngineThread.cpp | 3 ++- source/utils/CarlaJuceUtils.hpp | 11 ++++++++++- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/source/backend/engine/CarlaEngineOsc.cpp b/source/backend/engine/CarlaEngineOsc.cpp index 3ca8a39d9..f38acaf8d 100644 --- a/source/backend/engine/CarlaEngineOsc.cpp +++ b/source/backend/engine/CarlaEngineOsc.cpp @@ -41,8 +41,15 @@ extern int CarlaPluginSetOscBridgeInfo(CarlaPlugin* const plugin, const PluginBr CarlaEngineOsc::CarlaEngineOsc(CarlaEngine* const engine) noexcept : fEngine(engine), +#ifndef BUILD_BRIDGE + fControlData(), +#endif + fName(), + fServerPathTCP(), + fServerPathUDP(), fServerTCP(nullptr), - fServerUDP(nullptr) + fServerUDP(nullptr), + leakDetector() { CARLA_SAFE_ASSERT(engine != nullptr); carla_debug("CarlaEngineOsc::CarlaEngineOsc(%p)", engine); diff --git a/source/backend/engine/CarlaEngineOsc.hpp b/source/backend/engine/CarlaEngineOsc.hpp index 15869fd18..46e87bb1e 100644 --- a/source/backend/engine/CarlaEngineOsc.hpp +++ b/source/backend/engine/CarlaEngineOsc.hpp @@ -93,17 +93,16 @@ public: private: CarlaEngine* const fEngine; - CarlaString fName; +#ifndef BUILD_BRIDGE + CarlaOscData fControlData; // for carla-control +#endif + CarlaString fName; CarlaString fServerPathTCP; CarlaString fServerPathUDP; lo_server fServerTCP; lo_server fServerUDP; -#ifndef BUILD_BRIDGE - CarlaOscData fControlData; // for carla-control -#endif - // ------------------------------------------------------------------- int handleMessage(const bool isTCP, const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg); diff --git a/source/backend/engine/CarlaEngineThread.cpp b/source/backend/engine/CarlaEngineThread.cpp index d27b5a58f..0aeb54f69 100644 --- a/source/backend/engine/CarlaEngineThread.cpp +++ b/source/backend/engine/CarlaEngineThread.cpp @@ -25,7 +25,8 @@ CARLA_BACKEND_START_NAMESPACE CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine) noexcept : CarlaThread("CarlaEngineThread"), - kEngine(engine) + kEngine(engine), + leakDetector() { CARLA_SAFE_ASSERT(engine != nullptr); carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine); diff --git a/source/utils/CarlaJuceUtils.hpp b/source/utils/CarlaJuceUtils.hpp index 3d9597741..f3d91084e 100644 --- a/source/utils/CarlaJuceUtils.hpp +++ b/source/utils/CarlaJuceUtils.hpp @@ -45,12 +45,21 @@ #define CARLA_LEAK_DETECTOR(ClassName) \ friend class ::LeakedObjectDetector; \ static const char* getLeakedObjectClassName() noexcept { return #ClassName; } \ - ::LeakedObjectDetector CARLA_JOIN_MACRO(leakDetector, __LINE__); + ::LeakedObjectDetector leakDetector; + +#define CARLA_LEAK_DETECTOR_NAME(ClassName, leakDetectorName) \ + friend class ::LeakedObjectDetector; \ + static const char* getLeakedObjectClassName() noexcept { return #ClassName; } \ + ::LeakedObjectDetector leakDetectorName; #define CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ClassName) \ CARLA_DECLARE_NON_COPY_CLASS(ClassName) \ CARLA_LEAK_DETECTOR(ClassName) +#define CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR_NAME(ClassName, leakDetectorName) \ + CARLA_DECLARE_NON_COPY_CLASS(ClassName) \ + CARLA_LEAK_DETECTOR_NAME(ClassName, leakDetectorName) + //============================================================================== /** Embedding an instance of this class inside another class can be used as a low-overhead