From dc5c62b0f907f0a7da993881ddf47e2664680f1a Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 15 Feb 2014 13:50:15 +0000 Subject: [PATCH] Import 2 small patches from Carla --- .../juce/patches/audioprocessor_changes.patch | 13 +++++ .../patches/core_always-print-leak-objs.patch | 48 +++++++++++++++++++ .../format_types/juce_LADSPAPluginFormat.cpp | 2 +- .../memory/juce_LeakedObjectDetector.h | 9 ++-- 4 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 libs/juce/patches/audioprocessor_changes.patch create mode 100644 libs/juce/patches/core_always-print-leak-objs.patch diff --git a/libs/juce/patches/audioprocessor_changes.patch b/libs/juce/patches/audioprocessor_changes.patch new file mode 100644 index 00000000..ce6dd9af --- /dev/null +++ b/libs/juce/patches/audioprocessor_changes.patch @@ -0,0 +1,13 @@ +diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +index d528a27..05aa7e0 100644 +--- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp ++++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +@@ -26,7 +26,7 @@ + + } // (juce namespace) + +-#include ++#include "ladspa.h" + + namespace juce + { diff --git a/libs/juce/patches/core_always-print-leak-objs.patch b/libs/juce/patches/core_always-print-leak-objs.patch new file mode 100644 index 00000000..5e8f15cb --- /dev/null +++ b/libs/juce/patches/core_always-print-leak-objs.patch @@ -0,0 +1,48 @@ +diff --git a/modules/juce_core/memory/juce_LeakedObjectDetector.h b/modules/juce_core/memory/juce_LeakedObjectDetector.h +index 248e7bc..74b7779 100644 +--- a/modules/juce_core/memory/juce_LeakedObjectDetector.h ++++ b/modules/juce_core/memory/juce_LeakedObjectDetector.h +@@ -29,6 +29,7 @@ + #ifndef JUCE_LEAKEDOBJECTDETECTOR_H_INCLUDED + #define JUCE_LEAKEDOBJECTDETECTOR_H_INCLUDED + ++#define DBG2(dbgtext) { juce::String str; str << dbgtext; std::cout << str.toRawUTF8() << std::endl; } + + //============================================================================== + /** +@@ -55,7 +56,7 @@ public: + { + if (--(getCounter().numObjects) < 0) + { +- DBG ("*** Dangling pointer deletion! Class: " << getLeakedObjectClassName()); ++ DBG2 ("*** Dangling pointer deletion! Class: " << getLeakedObjectClassName()); + + /** If you hit this, then you've managed to delete more instances of this class than you've + created.. That indicates that you're deleting some dangling pointers. +@@ -68,7 +69,7 @@ public: + your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays, + ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs! + */ +- jassertfalse; ++ //jassertfalse; + } + } + +@@ -83,7 +84,7 @@ private: + { + if (numObjects.value > 0) + { +- DBG ("*** Leaked objects detected: " << numObjects.value << " instance(s) of class " << getLeakedObjectClassName()); ++ DBG2 ("*** Leaked objects detected: " << numObjects.value << " instance(s) of class " << getLeakedObjectClassName()); + + /** If you hit this, then you've leaked one or more objects of the type specified by + the 'OwnerClass' template parameter - the name should have been printed by the line above. +@@ -92,7 +93,7 @@ private: + your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays, + ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs! + */ +- jassertfalse; ++ //jassertfalse; + } + } + diff --git a/libs/juce/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/libs/juce/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index d528a271..05aa7e0d 100644 --- a/libs/juce/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/libs/juce/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -26,7 +26,7 @@ } // (juce namespace) -#include +#include "ladspa.h" namespace juce { diff --git a/libs/juce/source/modules/juce_core/memory/juce_LeakedObjectDetector.h b/libs/juce/source/modules/juce_core/memory/juce_LeakedObjectDetector.h index 248e7bcf..74b77793 100644 --- a/libs/juce/source/modules/juce_core/memory/juce_LeakedObjectDetector.h +++ b/libs/juce/source/modules/juce_core/memory/juce_LeakedObjectDetector.h @@ -29,6 +29,7 @@ #ifndef JUCE_LEAKEDOBJECTDETECTOR_H_INCLUDED #define JUCE_LEAKEDOBJECTDETECTOR_H_INCLUDED +#define DBG2(dbgtext) { juce::String str; str << dbgtext; std::cout << str.toRawUTF8() << std::endl; } //============================================================================== /** @@ -55,7 +56,7 @@ public: { if (--(getCounter().numObjects) < 0) { - DBG ("*** Dangling pointer deletion! Class: " << getLeakedObjectClassName()); + DBG2 ("*** Dangling pointer deletion! Class: " << getLeakedObjectClassName()); /** If you hit this, then you've managed to delete more instances of this class than you've created.. That indicates that you're deleting some dangling pointers. @@ -68,7 +69,7 @@ public: your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays, ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs! */ - jassertfalse; + //jassertfalse; } } @@ -83,7 +84,7 @@ private: { if (numObjects.value > 0) { - DBG ("*** Leaked objects detected: " << numObjects.value << " instance(s) of class " << getLeakedObjectClassName()); + DBG2 ("*** Leaked objects detected: " << numObjects.value << " instance(s) of class " << getLeakedObjectClassName()); /** If you hit this, then you've leaked one or more objects of the type specified by the 'OwnerClass' template parameter - the name should have been printed by the line above. @@ -92,7 +93,7 @@ private: your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays, ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs! */ - jassertfalse; + //jassertfalse; } }