diff --git a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj index fe5a21bf61..21c3c4c1a8 100644 --- a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 44; + objectVersion = 45; objects = { 0F4BA87762766B98D5B58AD0 = { isa = PBXBuildFile; fileRef = 144F56FCF3DF9EC922765901; }; @@ -1897,6 +1897,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG=1", "DEBUG=1", + "JUCE_ObjCExtraSuffix=JSlRKlNBb5", "JUCER_XCODE_MAC_F6D2F4CF=1"); }; name = Debug; }; 9DE19CD5BB8E12A153385ADD = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; @@ -1914,6 +1915,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "_NDEBUG=1", "NDEBUG=1", + "JUCE_ObjCExtraSuffix=JSlRKlNBb5", "JUCER_XCODE_MAC_F6D2F4CF=1"); }; name = Release; }; 8E935B9E7F2982A06CD7EF99 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -2294,7 +2296,7 @@ 55EDB4D9B702B469DB4655C3 ); runOnlyForDeploymentPostprocessing = 0; }; 01555BA382FAED280FF5F58A = { isa = PBXNativeTarget; buildConfigurationList = D14EC3F0DC5861E37D35E15A; buildPhases = ( 8914D147048B9EE245989ACB ); buildRules = ( ); dependencies = ( ); name = Juce; productName = Juce; productReference = 389351359BA78C682E1931A6; productType = "com.apple.product-type.library.static"; }; - FCFFEDFC83101B196BFA2AE2 = { isa = PBXProject; buildConfigurationList = 3A1CB6B5ECF4A79CDE35CC66; compatibilityVersion = "Xcode 3.0"; hasScannedForEncodings = 0; mainGroup = 992526B83B6AA618A4FAECEB; projectDirPath = ""; projectRoot = ""; targets = ( 01555BA382FAED280FF5F58A ); }; + FCFFEDFC83101B196BFA2AE2 = { isa = PBXProject; buildConfigurationList = 3A1CB6B5ECF4A79CDE35CC66; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 0; mainGroup = 992526B83B6AA618A4FAECEB; projectDirPath = ""; projectRoot = ""; targets = ( 01555BA382FAED280FF5F58A ); }; }; rootObject = FCFFEDFC83101B196BFA2AE2; } diff --git a/Builds/iPhone/Juce.xcodeproj/project.pbxproj b/Builds/iOS/Juce.xcodeproj/project.pbxproj similarity index 99% rename from Builds/iPhone/Juce.xcodeproj/project.pbxproj rename to Builds/iOS/Juce.xcodeproj/project.pbxproj index e6bae0712a..dfbb6085f5 100644 --- a/Builds/iPhone/Juce.xcodeproj/project.pbxproj +++ b/Builds/iOS/Juce.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 44; + objectVersion = 45; objects = { 0F4BA87762766B98D5B58AD0 = { isa = PBXBuildFile; fileRef = 144F56FCF3DF9EC922765901; }; @@ -1889,7 +1889,6 @@ SYMROOT = ../../bin; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; DEPLOYMENT_LOCATION = YES; - SDKROOT = iphonesimulator3.2; ONLY_ACTIVE_ARCH = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -1897,7 +1896,8 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG=1", "DEBUG=1", - "JUCER_XCODE_IPHONE_25ADD7EF=1"); }; name = Debug; }; + "JUCE_ObjCExtraSuffix=JSlRKlNBb5", + "JUCER_XCODE_IPHONE_5BC26AE3=1"); }; name = Debug; }; 9DE19CD5BB8E12A153385ADD = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; PREBINDING = NO; @@ -1908,13 +1908,13 @@ SYMROOT = ../../bin; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; DEPLOYMENT_LOCATION = YES; - SDKROOT = iphonesimulator3.2; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "_NDEBUG=1", "NDEBUG=1", - "JUCER_XCODE_IPHONE_25ADD7EF=1"); }; name = Release; }; + "JUCE_ObjCExtraSuffix=JSlRKlNBb5", + "JUCER_XCODE_IPHONE_5BC26AE3=1"); }; name = Release; }; 8E935B9E7F2982A06CD7EF99 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; GCC_C_LANGUAGE_STANDARD = c99; @@ -1928,6 +1928,9 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; ZERO_LINK = NO; DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "jucedebug"; }; name = Debug; }; @@ -1944,6 +1947,9 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; ZERO_LINK = NO; DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "juce"; }; name = Release; }; @@ -2294,7 +2300,7 @@ 55EDB4D9B702B469DB4655C3 ); runOnlyForDeploymentPostprocessing = 0; }; 01555BA382FAED280FF5F58A = { isa = PBXNativeTarget; buildConfigurationList = D14EC3F0DC5861E37D35E15A; buildPhases = ( 8914D147048B9EE245989ACB ); buildRules = ( ); dependencies = ( ); name = Juce; productName = Juce; productReference = 389351359BA78C682E1931A6; productType = "com.apple.product-type.library.static"; }; - FCFFEDFC83101B196BFA2AE2 = { isa = PBXProject; buildConfigurationList = 3A1CB6B5ECF4A79CDE35CC66; compatibilityVersion = "Xcode 3.0"; hasScannedForEncodings = 0; mainGroup = 992526B83B6AA618A4FAECEB; projectDirPath = ""; projectRoot = ""; targets = ( 01555BA382FAED280FF5F58A ); }; + FCFFEDFC83101B196BFA2AE2 = { isa = PBXProject; buildConfigurationList = 3A1CB6B5ECF4A79CDE35CC66; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 0; mainGroup = 992526B83B6AA618A4FAECEB; projectDirPath = ""; projectRoot = ""; targets = ( 01555BA382FAED280FF5F58A ); }; }; rootObject = FCFFEDFC83101B196BFA2AE2; } diff --git a/Juce.jucer b/Juce.jucer index b3e6fde580..73f92a000a 100644 --- a/Juce.jucer +++ b/Juce.jucer @@ -10,9 +10,9 @@ jucerVersion="3.0.0"> - + juceFolder="." objCExtraSuffix="JSlRKlNBb5"/> + diff --git a/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj b/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj index 7ad0cca98c..9341922d87 100644 --- a/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj +++ b/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 44; + objectVersion = 45; objects = { 7BDFF9F0E16DF33A980F46DC = { isa = PBXBuildFile; fileRef = 046FA2877C08618339161EE2; }; @@ -256,6 +256,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG=1", "DEBUG=1", + "JUCE_ObjCExtraSuffix=zNNCr", "JUCER_XCODE_MAC_F6D2F4CF=1"); }; name = Debug; }; 673FACB8969ADED17ACEFF7C = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; @@ -270,6 +271,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "_NDEBUG=1", "NDEBUG=1", + "JUCE_ObjCExtraSuffix=zNNCr", "JUCER_XCODE_MAC_F6D2F4CF=1"); }; name = Release; }; 69D26A715A354ED1735D8438 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -352,7 +354,7 @@ 87CCE4CB1FAB40B6F21DEACE, 5362E03ADF975A126C1F2F7B, 08881173C882953BE5F11D6C ); buildRules = ( ); dependencies = ( ); name = "The Jucer"; productName = "The Jucer"; productReference = 12E1601866B3489844AFD645; productInstallPath = "$(HOME)/Applications"; productType = "com.apple.product-type.application"; }; - D64DFDDF5D2CD74A8171CF81 = { isa = PBXProject; buildConfigurationList = 045AC698C60073CCF5CC6116; compatibilityVersion = "Xcode 3.0"; hasScannedForEncodings = 0; mainGroup = B01AA6CC1327A5DBCB35B7BF; projectDirPath = ""; projectRoot = ""; targets = ( EB946A866C16B958168C9A39 ); }; + D64DFDDF5D2CD74A8171CF81 = { isa = PBXProject; buildConfigurationList = 045AC698C60073CCF5CC6116; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 0; mainGroup = B01AA6CC1327A5DBCB35B7BF; projectDirPath = ""; projectRoot = ""; targets = ( EB946A866C16B958168C9A39 ); }; }; rootObject = D64DFDDF5D2CD74A8171CF81; } diff --git a/extras/Jucer (experimental)/Jucer.jucer b/extras/Jucer (experimental)/Jucer.jucer index e8d53e8e5e..b9e039f2d9 100644 --- a/extras/Jucer (experimental)/Jucer.jucer +++ b/extras/Jucer (experimental)/Jucer.jucer @@ -12,7 +12,7 @@ pluginAUViewClass="TheJucerAU_V1" pluginRTASCategory="" bundleIdentifier="com.rawmaterialsoftware.thejucer"> + juceFolder="../.." documentExtensions=".jucer" objCExtraSuffix="zNNCr"/> & props) props.getLast()->setTooltip ("Sets an icon to use for the executable."); } - props.add (new TextPropertyComponent (getObjectiveCClassSuffix(), "Objective-C Name Suffix", 256, false)); - props.getLast()->setTooltip ("An optional string which will be appended to objective-C class names. If you're building a plugin, it's important to define this, to avoid name clashes between multiple plugin modules that are dynamically loaded into the same address space."); - if (isAudioPlugin()) { props.add (new BooleanPropertyComponent (shouldBuildVST(), "Build VST", "Enabled")); diff --git a/extras/Jucer (experimental)/Source/Project/jucer_Project.h b/extras/Jucer (experimental)/Source/Project/jucer_Project.h index 44f73f3aa8..f87a973483 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_Project.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_Project.h @@ -110,8 +110,6 @@ public: const Image getBigIcon(); const Image getSmallIcon(); - Value getObjectiveCClassSuffix() const { return getProjectValue ("objCSuffix"); } - Value shouldBuildVST() const { return getProjectValue ("buildVST"); } Value shouldBuildRTAS() const { return getProjectValue ("buildRTAS"); } Value shouldBuildAU() const { return getProjectValue ("buildAU"); } diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h index 15902c7f09..169acdc843 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h @@ -52,8 +52,6 @@ public: projectGUID = createGUID (project.getProjectUID()); } - ~MSVCProjectExporterBase() {} - //============================================================================== bool isPossibleForCurrentProject() { return true; } bool usesMMFiles() const { return false; } @@ -464,8 +462,6 @@ public: name = getName(); } - ~MSVCProjectExporterVC2008() {} - static const char* getName() { return "Visual Studio 2008"; } static const char* getValueTreeTypeName() { return "VS2008"; } @@ -830,8 +826,6 @@ public: name = getName(); } - ~MSVCProjectExporterVC2005() {} - static const char* getName() { return "Visual Studio 2005"; } static const char* getValueTreeTypeName() { return "VS2005"; } @@ -864,8 +858,6 @@ public: name = getName(); } - ~MSVCProjectExporterVC6() {} - static const char* getName() { return "Visual C++ 6.0"; } static const char* getValueTreeTypeName() { return "MSVC6"; } @@ -1133,8 +1125,6 @@ public: name = getName(); } - ~MSVCProjectExporterVC2010() {} - static const char* getName() { return "Visual Studio 2010"; } static const char* getValueTreeTypeName() { return "VS2010"; } diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_Make.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_Make.h index 1d6833c4cf..582f74fc5c 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_Make.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_Make.h @@ -59,10 +59,6 @@ public: getVSTFolder() = "~/SDKs/vstsdk2.4"; } - ~MakefileProjectExporter() - { - } - //============================================================================== bool isDefaultFormatForCurrentOS() { diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h index f2b4dd38d2..430b49581b 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h @@ -55,10 +55,9 @@ public: if (getRTASFolder().toString().isEmpty()) getRTASFolder() = "~/SDKs/PT_80_SDK"; - } - ~XCodeProjectExporter() - { + if (getSettings() ["objCExtraSuffix"].isVoid()) + getObjCSuffix() = createAlphaNumericUID(); } static XCodeProjectExporter* createForSettings (Project& project, const ValueTree& settings) @@ -72,6 +71,8 @@ public: } //============================================================================== + Value getObjCSuffix() { return getSetting ("objCExtraSuffix"); } + bool isDefaultFormatForCurrentOS() { #if JUCE_MAC @@ -88,7 +89,7 @@ public: { ProjectExporter::createPropertyEditors (props); - props.add (new TextPropertyComponent (getSetting ("objCExtraSuffix"), "Objective-C class name suffix", 64, false)); + props.add (new TextPropertyComponent (getObjCSuffix(), "Objective-C class name suffix", 64, false)); props.getLast()->setTooltip ("Because objective-C linkage is done by string-matching, you can get horrible linkage mix-ups when different modules containing the " "same class-names are loaded simultaneously. This setting lets you provide a unique string that will be used in naming the obj-C classes in your executable to avoid this."); @@ -504,6 +505,13 @@ private: s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES"); } + if (iPhone) + { + s.add ("\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\""); + s.add ("SDKROOT = iphoneos"); + s.add ("TARGETED_DEVICE_FAMILY = \"1,2\""); + } + s.add ("ZERO_LINK = NO"); if (! isRTAS()) // (dwarf seems to be incompatible with the RTAS libs) @@ -567,11 +575,7 @@ private: jassertfalse; } - if (iPhone) - { - s.add ("SDKROOT = iphonesimulator3.2"); - } - else + if (! iPhone) { const String sdk (config.getMacSDKVersion().toString()); const String sdkCompat (config.getMacCompatibilityVersion().toString()); @@ -638,7 +642,7 @@ private: } { - const String objCSuffix (getSetting ("objCExtraSuffix").toString().trim()); + const String objCSuffix (getObjCSuffix().toString().trim()); if (objCSuffix.isNotEmpty()) defines.set ("JUCE_ObjCExtraSuffix", replacePreprocessorTokens (config, objCSuffix)); } @@ -692,7 +696,7 @@ private: output << "// !$*UTF8*$!\n{\n" "\tarchiveVersion = 1;\n" "\tclasses = {\n\t};\n" - "\tobjectVersion = 44;\n" + "\tobjectVersion = 45;\n" "\tobjects = {\n\n"; Array objects; @@ -1019,7 +1023,7 @@ private: ValueTree* v = new ValueTree (createID ("__root")); v->setProperty ("isa", "PBXProject", 0); v->setProperty ("buildConfigurationList", createID ("__projList"), 0); - v->setProperty ("compatibilityVersion", "Xcode 3.0", 0); + v->setProperty ("compatibilityVersion", "Xcode 3.1", 0); v->setProperty ("hasScannedForEncodings", (int) 0, 0); v->setProperty ("mainGroup", getIDForGroup (project.getMainGroup()), 0); v->setProperty ("projectDirPath", "\"\"", 0); diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h index 98da02b571..2148a7edc1 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h @@ -364,9 +364,6 @@ private: << "#define JucePlugin_RTASManufacturerCode JucePlugin_ManufacturerCode" << newLine << "#define JucePlugin_RTASProductId JucePlugin_PluginCode" << newLine; - if (project.getObjectiveCClassSuffix().toString().isNotEmpty()) - out << "#define JUCE_ObjCExtraSuffix " << project.getObjectiveCClassSuffix().toString() << newLine; - out << "#define JUCE_USE_VSTSDK_2_4 1" << newLine << newLine << "#endif // " << headerGuard << newLine; diff --git a/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.cpp b/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.cpp index 73f5f5e0b6..c9cfbd0e02 100644 --- a/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.cpp +++ b/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.cpp @@ -38,7 +38,9 @@ const String createAlphaNumericUID() static const char chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Random r (Random::getSystemRandom().nextInt64()); - for (int i = 7; --i >= 0;) + uid << chars [r.nextInt (52)]; // make sure the first character is always a letter + + for (int i = 5; --i >= 0;) { r.setSeedRandomly(); uid << chars [r.nextInt (numElementsInArray (chars))]; diff --git a/extras/amalgamator/Amalgamator.jucer b/extras/amalgamator/Amalgamator.jucer index 2a602ad10d..fb070464db 100644 --- a/extras/amalgamator/Amalgamator.jucer +++ b/extras/amalgamator/Amalgamator.jucer @@ -10,7 +10,7 @@ pluginAUViewClass="AmalgamatorAU_V1" pluginRTASCategory="" bundleIdentifier="com.rawmaterialsoftware.amalgamator"> + juceFolder="../../../juce" objCExtraSuffix="OTDGfH"/> + juceFolder="../.." objCExtraSuffix="M73TRi"/> + juceFolder="../../../juce" objCExtraSuffix="OeJtJb"/> - + juceFolder="../.." objCExtraSuffix="JtTAKTK1s"/> + - + juceFolder="../../../juce" objCExtraSuffix="JSLvvV6j"/> + 256) @@ -15594,7 +15606,7 @@ XmlElement::XmlAttributeNode::XmlAttributeNode (const String& name_, const Strin value (value_) { #if JUCE_DEBUG - // this checks whether the attribute name string contains any illegals characters.. + // this checks whether the attribute name string contains any illegal characters.. for (const juce_wchar* t = name; *t != 0; ++t) jassert (CharacterFunctions::isLetterOrDigit (*t) || *t == '_' || *t == '-' || *t == ':'); #endif @@ -240065,19 +240077,14 @@ class FontDCHolder : private DeletedAtShutdown public: FontDCHolder() - : dc (0), numKPs (0), size (0), + : dc (0), fontH (0), previousFontH (0), numKPs (0), size (0), bold (false), italic (false) { } ~FontDCHolder() { - if (dc != 0) - { - DeleteDC (dc); - DeleteObject (fontH); - } - + deleteDCAndFont(); clearSingletonInstance(); } @@ -240092,14 +240099,7 @@ public: italic = italic_; size = size_; - if (dc != 0) - { - DeleteDC (dc); - DeleteObject (fontH); - kps.free(); - } - - fontH = 0; + deleteDCAndFont(); dc = CreateCompatibleDC (0); SetMapperFlags (dc, 0); @@ -240122,7 +240122,7 @@ public: if (standardSizedFont != 0) { - if (SelectObject (dc, standardSizedFont) != 0) + if ((previousFontH = SelectObject (dc, standardSizedFont)) != 0) { fontH = standardSizedFont; @@ -240139,14 +240139,6 @@ public: } } } - else - { - jassertfalse; - } - } - else - { - jassertfalse; } } @@ -240169,12 +240161,31 @@ public: private: HFONT fontH; + HGDIOBJ previousFontH; HDC dc; String fontName; HeapBlock kps; int numKPs, size; bool bold, italic; + void deleteDCAndFont() + { + if (dc != 0) + { + SelectObject (dc, previousFontH); // Replacing the previous font before deleting the DC avoids a warning in BoundsChecker + DeleteDC (dc); + dc = 0; + } + + if (fontH != 0) + { + DeleteObject (fontH); + fontH = 0; + } + + kps.free(); + } + JUCE_DECLARE_NON_COPYABLE (FontDCHolder); }; @@ -241336,6 +241347,7 @@ class WindowsBitmapImage : public Image::SharedImage public: HBITMAP hBitmap; + HGDIOBJ previousBitmap; BITMAPV4HEADER bitmapInfo; HDC hdc; unsigned char* bitmapData; @@ -241383,7 +241395,7 @@ public: (void**) &bitmapData, 0, 0); - SelectObject (hdc, hBitmap); + previousBitmap = SelectObject (hdc, hBitmap); if (format_ == Image::ARGB && clearImage) zeromem (bitmapData, abs (h * lineStride)); @@ -241393,6 +241405,7 @@ public: ~WindowsBitmapImage() { + SelectObject (hdc, previousBitmap); // Selecting the previous bitmap before deleting the DC avoids a warning in BoundsChecker DeleteDC (hdc); DeleteObject (hBitmap); } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 174b231f03..47c84cadc6 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 13 +#define JUCE_BUILDNUMBER 14 /** Current Juce version number. @@ -6375,8 +6375,8 @@ public: ObjectType* const oldItem = item; item = newItem; - item->nextListItem = oldItem->nextListItem; - oldItem->nextListItem = 0; + item->nextListItem = oldItem->nextListItem.item; + oldItem->nextListItem = (ObjectType*) 0; return oldItem; } @@ -6417,7 +6417,7 @@ public: if (oldItem != 0) { item = oldItem->nextListItem; - oldItem->nextListItem = 0; + oldItem->nextListItem = (ObjectType*) 0; } return oldItem; @@ -6513,6 +6513,8 @@ public: private: ObjectType* item; + + JUCE_DECLARE_NON_COPYABLE (LinkedListPointer); }; #endif // __JUCE_LINKEDLISTPOINTER_JUCEHEADER__ @@ -6607,7 +6609,9 @@ private: { public: NamedValue() throw(); + NamedValue (const NamedValue&); NamedValue (const Identifier& name, const var& value); + NamedValue& operator= (const NamedValue&); bool operator== (const NamedValue& other) const throw(); LinkedListPointer nextListItem; @@ -21080,7 +21084,6 @@ private: static int doubleClickTimeOutMs; MouseEvent& operator= (const MouseEvent&); - JUCE_LEAK_DETECTOR (MouseEvent); }; #endif // __JUCE_MOUSEEVENT_JUCEHEADER__ @@ -57211,11 +57214,6 @@ public: return *this; } - /** Destructor. */ - ~SelectedItemSet() - { - } - /** Clears any other currently selected items, and selects this item. If this item is already the only thing selected, no change notification diff --git a/src/containers/juce_LinkedListPointer.h b/src/containers/juce_LinkedListPointer.h index 49518c967e..1f33da629e 100644 --- a/src/containers/juce_LinkedListPointer.h +++ b/src/containers/juce_LinkedListPointer.h @@ -200,8 +200,8 @@ public: ObjectType* const oldItem = item; item = newItem; - item->nextListItem = oldItem->nextListItem; - oldItem->nextListItem = 0; + item->nextListItem = oldItem->nextListItem.item; + oldItem->nextListItem = (ObjectType*) 0; return oldItem; } @@ -242,7 +242,7 @@ public: if (oldItem != 0) { item = oldItem->nextListItem; - oldItem->nextListItem = 0; + oldItem->nextListItem = (ObjectType*) 0; } return oldItem; @@ -339,6 +339,8 @@ public: private: //============================================================================== ObjectType* item; + + JUCE_DECLARE_NON_COPYABLE (LinkedListPointer); }; diff --git a/src/containers/juce_NamedValueSet.cpp b/src/containers/juce_NamedValueSet.cpp index 3bb9c76018..3c42d31e7f 100644 --- a/src/containers/juce_NamedValueSet.cpp +++ b/src/containers/juce_NamedValueSet.cpp @@ -41,6 +41,18 @@ inline NamedValueSet::NamedValue::NamedValue (const Identifier& name_, const var { } +NamedValueSet::NamedValue::NamedValue (const NamedValue& other) + : name (other.name), value (other.value) +{ +} + +NamedValueSet::NamedValue& NamedValueSet::NamedValue::operator= (const NamedValueSet::NamedValue& other) +{ + name = other.name; + value = other.value; + return *this; +} + bool NamedValueSet::NamedValue::operator== (const NamedValueSet::NamedValue& other) const throw() { return name == other.name && value == other.value; diff --git a/src/containers/juce_NamedValueSet.h b/src/containers/juce_NamedValueSet.h index 5219f0e374..9a626169cf 100644 --- a/src/containers/juce_NamedValueSet.h +++ b/src/containers/juce_NamedValueSet.h @@ -122,7 +122,9 @@ private: { public: NamedValue() throw(); + NamedValue (const NamedValue&); NamedValue (const Identifier& name, const var& value); + NamedValue& operator= (const NamedValue&); bool operator== (const NamedValue& other) const throw(); LinkedListPointer nextListItem; diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index fcf6e97f74..132b4ea3f0 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 13 +#define JUCE_BUILDNUMBER 14 /** Current Juce version number. diff --git a/src/gui/components/mouse/juce_MouseEvent.h b/src/gui/components/mouse/juce_MouseEvent.h index 349f033205..95a5778c5d 100644 --- a/src/gui/components/mouse/juce_MouseEvent.h +++ b/src/gui/components/mouse/juce_MouseEvent.h @@ -321,7 +321,6 @@ private: static int doubleClickTimeOutMs; MouseEvent& operator= (const MouseEvent&); - JUCE_LEAK_DETECTOR (MouseEvent); }; diff --git a/src/maths/juce_Expression.cpp b/src/maths/juce_Expression.cpp index 9dd089cb56..cf1fef9829 100644 --- a/src/maths/juce_Expression.cpp +++ b/src/maths/juce_Expression.cpp @@ -116,7 +116,7 @@ public: bool referencesSymbol (const String& s, const EvaluationContext* c, int recursionDepth) const { - if (s == mainSymbol) + if (s == mainSymbol || (s.containsChar ('.') && s == toString())) return true; if (++recursionDepth > 256) diff --git a/src/native/windows/juce_win32_Fonts.cpp b/src/native/windows/juce_win32_Fonts.cpp index f6166e9f84..9c4a35f98f 100644 --- a/src/native/windows/juce_win32_Fonts.cpp +++ b/src/native/windows/juce_win32_Fonts.cpp @@ -129,19 +129,14 @@ class FontDCHolder : private DeletedAtShutdown public: //============================================================================== FontDCHolder() - : dc (0), numKPs (0), size (0), + : dc (0), fontH (0), previousFontH (0), numKPs (0), size (0), bold (false), italic (false) { } ~FontDCHolder() { - if (dc != 0) - { - DeleteDC (dc); - DeleteObject (fontH); - } - + deleteDCAndFont(); clearSingletonInstance(); } @@ -157,14 +152,7 @@ public: italic = italic_; size = size_; - if (dc != 0) - { - DeleteDC (dc); - DeleteObject (fontH); - kps.free(); - } - - fontH = 0; + deleteDCAndFont(); dc = CreateCompatibleDC (0); SetMapperFlags (dc, 0); @@ -187,7 +175,7 @@ public: if (standardSizedFont != 0) { - if (SelectObject (dc, standardSizedFont) != 0) + if ((previousFontH = SelectObject (dc, standardSizedFont)) != 0) { fontH = standardSizedFont; @@ -204,14 +192,6 @@ public: } } } - else - { - jassertfalse; - } - } - else - { - jassertfalse; } } @@ -236,12 +216,31 @@ public: private: //============================================================================== HFONT fontH; + HGDIOBJ previousFontH; HDC dc; String fontName; HeapBlock kps; int numKPs, size; bool bold, italic; + void deleteDCAndFont() + { + if (dc != 0) + { + SelectObject (dc, previousFontH); // Replacing the previous font before deleting the DC avoids a warning in BoundsChecker + DeleteDC (dc); + dc = 0; + } + + if (fontH != 0) + { + DeleteObject (fontH); + fontH = 0; + } + + kps.free(); + } + JUCE_DECLARE_NON_COPYABLE (FontDCHolder); }; diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index c14232c1eb..ce66c1d1e5 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -147,6 +147,7 @@ class WindowsBitmapImage : public Image::SharedImage public: //============================================================================== HBITMAP hBitmap; + HGDIOBJ previousBitmap; BITMAPV4HEADER bitmapInfo; HDC hdc; unsigned char* bitmapData; @@ -195,7 +196,7 @@ public: (void**) &bitmapData, 0, 0); - SelectObject (hdc, hBitmap); + previousBitmap = SelectObject (hdc, hBitmap); if (format_ == Image::ARGB && clearImage) zeromem (bitmapData, abs (h * lineStride)); @@ -205,6 +206,7 @@ public: ~WindowsBitmapImage() { + SelectObject (hdc, previousBitmap); // Selecting the previous bitmap before deleting the DC avoids a warning in BoundsChecker DeleteDC (hdc); DeleteObject (hBitmap); } diff --git a/src/text/juce_XmlElement.cpp b/src/text/juce_XmlElement.cpp index 5d8cac5291..823598c096 100644 --- a/src/text/juce_XmlElement.cpp +++ b/src/text/juce_XmlElement.cpp @@ -46,7 +46,7 @@ XmlElement::XmlAttributeNode::XmlAttributeNode (const String& name_, const Strin value (value_) { #if JUCE_DEBUG - // this checks whether the attribute name string contains any illegals characters.. + // this checks whether the attribute name string contains any illegal characters.. for (const juce_wchar* t = name; *t != 0; ++t) jassert (CharacterFunctions::isLetterOrDigit (*t) || *t == '_' || *t == '-' || *t == ':'); #endif diff --git a/src/utilities/juce_SelectedItemSet.h b/src/utilities/juce_SelectedItemSet.h index 3d8779cf99..e93814510b 100644 --- a/src/utilities/juce_SelectedItemSet.h +++ b/src/utilities/juce_SelectedItemSet.h @@ -82,11 +82,6 @@ public: return *this; } - /** Destructor. */ - ~SelectedItemSet() - { - } - //============================================================================== /** Clears any other currently selected items, and selects this item.