From c22c06c80c779db59c471fe63ed5d5d7d9e44069 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Sat, 2 Jan 2010 23:01:18 +0000 Subject: [PATCH] New class: ScopedPointer, which auto-releases a pointer when it goes out of scope. I've used this extensively to replace a lot of pointer deletions with more RAII-style patterns. --- build/linux/JUCE.make | 368 +++--- build/macosx/Juce.xcodeproj/project.pbxproj | 26 +- extras/juce demo/build/linux/JuceDemo.make | 34 +- juce_amalgamated.cpp | 1089 ++++++----------- juce_amalgamated.h | 275 ++++- .../juce_ApplicationCommandManager.cpp | 2 +- .../juce_ApplicationCommandManager.h | 2 +- .../juce_ApplicationCommandTarget.cpp | 3 +- .../juce_ApplicationProperties.cpp | 8 +- src/application/juce_ApplicationProperties.h | 3 +- .../audio_file_formats/juce_AudioCDReader.cpp | 9 +- .../audio_file_formats/juce_AudioCDReader.h | 2 +- .../juce_AudioThumbnail.cpp | 10 +- .../audio_file_formats/juce_AudioThumbnail.h | 4 +- .../juce_OggVorbisAudioFormat.cpp | 4 +- .../juce_WavAudioFormat.cpp | 43 +- .../juce_AudioTransportSource.cpp | 8 +- src/audio/devices/juce_AudioDeviceManager.cpp | 24 +- src/audio/devices/juce_AudioDeviceManager.h | 8 +- src/audio/midi/juce_MidiFile.cpp | 39 +- src/audio/midi/juce_MidiFile.h | 4 +- .../plugins/formats/juce_VSTPluginFormat.cpp | 14 +- src/audio/synthesisers/juce_Sampler.cpp | 3 - src/audio/synthesisers/juce_Sampler.h | 2 +- src/containers/juce_OwnedArray.h | 9 +- src/containers/juce_ScopedPointer.h | 181 +++ src/core/juce_FileLogger.cpp | 6 +- src/core/juce_FileLogger.h | 2 +- src/core/juce_Logger.cpp | 2 +- src/cryptography/juce_MD5.cpp | 8 +- src/events/juce_InterprocessConnection.cpp | 48 +- src/events/juce_InterprocessConnection.h | 5 +- .../juce_InterprocessConnectionServer.cpp | 19 +- .../juce_InterprocessConnectionServer.h | 2 +- src/events/juce_MessageManager.cpp | 11 +- src/events/juce_MessageManager.h | 4 +- src/gui/components/buttons/juce_Button.cpp | 3 +- src/gui/components/buttons/juce_Button.h | 2 +- .../buttons/juce_DrawableButton.cpp | 16 - .../components/buttons/juce_DrawableButton.h | 10 +- .../components/buttons/juce_ImageButton.cpp | 26 +- .../components/buttons/juce_ToolbarButton.cpp | 2 - .../components/buttons/juce_ToolbarButton.h | 3 +- src/gui/components/controls/juce_Label.cpp | 11 +- src/gui/components/controls/juce_Label.h | 4 +- src/gui/components/controls/juce_ListBox.cpp | 4 +- src/gui/components/controls/juce_Slider.cpp | 4 +- src/gui/components/controls/juce_Slider.h | 2 +- .../controls/juce_TableHeaderComponent.cpp | 14 +- .../controls/juce_TableHeaderComponent.h | 2 +- .../components/controls/juce_TextEditor.cpp | 5 +- .../controls/juce_ToolbarItemComponent.cpp | 4 +- .../controls/juce_ToolbarItemComponent.h | 2 +- src/gui/components/controls/juce_TreeView.cpp | 3 +- .../juce_DirectoryContentsList.cpp | 9 +- .../filebrowser/juce_FileBrowserComponent.cpp | 2 +- .../filebrowser/juce_FileBrowserComponent.h | 2 +- .../filebrowser/juce_FileChooser.cpp | 4 +- .../filebrowser/juce_FileListComponent.cpp | 2 +- .../filebrowser/juce_FileTreeComponent.cpp | 4 +- .../juce_ImagePreviewComponent.cpp | 13 +- .../filebrowser/juce_ImagePreviewComponent.h | 2 +- src/gui/components/juce_Component.cpp | 19 +- .../juce_KeyMappingEditorComponent.cpp | 5 +- .../keyboard/juce_KeyPressMappingSet.cpp | 4 +- .../layout/juce_ComponentMovementWatcher.cpp | 4 - .../layout/juce_ComponentMovementWatcher.h | 2 +- .../layout/juce_TabbedButtonBar.cpp | 5 +- .../menus/juce_MenuBarComponent.cpp | 27 +- .../components/menus/juce_MenuBarComponent.h | 2 +- src/gui/components/menus/juce_PopupMenu.cpp | 70 +- .../mouse/juce_DragAndDropContainer.cpp | 86 +- .../mouse/juce_DragAndDropContainer.h | 2 +- .../special/juce_ColourSelector.cpp | 15 +- .../components/special/juce_NSViewComponent.h | 2 +- .../special/juce_PreferencesPanel.cpp | 6 +- .../special/juce_PreferencesPanel.h | 2 +- .../components/windows/juce_AlertWindow.cpp | 9 +- .../components/windows/juce_ComponentPeer.cpp | 6 +- .../components/windows/juce_ComponentPeer.h | 2 +- .../windows/juce_DocumentWindow.cpp | 24 +- .../components/windows/juce_DocumentWindow.h | 6 +- .../windows/juce_ResizableWindow.cpp | 32 +- .../components/windows/juce_ResizableWindow.h | 6 +- .../components/windows/juce_SplashScreen.cpp | 10 +- .../components/windows/juce_SplashScreen.h | 1 - .../windows/juce_ThreadWithProgressWindow.cpp | 1 - .../windows/juce_ThreadWithProgressWindow.h | 3 +- .../windows/juce_TopLevelWindow.cpp | 9 +- .../components/windows/juce_TopLevelWindow.h | 2 +- src/gui/graphics/contexts/juce_FillType.cpp | 13 +- src/gui/graphics/contexts/juce_FillType.h | 3 +- .../juce_LowLevelGraphicsSoftwareRenderer.cpp | 10 +- .../juce_LowLevelGraphicsSoftwareRenderer.h | 2 +- src/gui/graphics/drawables/juce_Drawable.cpp | 19 +- .../graphics/drawables/juce_DrawableImage.cpp | 7 +- src/gui/graphics/fonts/juce_TextLayout.cpp | 5 +- src/gui/graphics/imaging/juce_ImageCache.cpp | 10 +- src/gui/graphics/imaging/juce_ImageCache.h | 7 + .../imaging/juce_ImageConvolutionKernel.cpp | 4 +- .../graphics/imaging/juce_ImageFileFormat.cpp | 6 +- src/io/files/juce_DirectoryIterator.cpp | 7 +- src/io/files/juce_DirectoryIterator.h | 3 +- src/io/files/juce_File.cpp | 18 +- src/io/files/juce_ZipFile.cpp | 23 +- src/io/files/juce_ZipFile.h | 2 +- src/io/network/juce_URL.cpp | 19 +- .../juce_GZIPCompressorOutputStream.cpp | 3 +- .../juce_GZIPDecompressorInputStream.cpp | 6 +- src/juce_core_includes.h | 3 + src/native/linux/juce_linux_Windowing.cpp | 25 +- src/native/mac/juce_mac_AudioCDBurner.mm | 6 +- src/native/mac/juce_mac_CoreAudio.cpp | 6 +- .../mac/juce_mac_CoreGraphicsContext.mm | 4 +- src/native/mac/juce_mac_CoreMidi.cpp | 20 +- src/native/mac/juce_mac_Fonts.mm | 9 +- src/native/mac/juce_mac_MouseCursor.mm | 10 +- src/native/mac/juce_mac_NSViewComponent.mm | 6 +- .../windows/juce_win32_ActiveXComponent.cpp | 6 +- src/native/windows/juce_win32_Messaging.cpp | 3 +- src/native/windows/juce_win32_Midi.cpp | 18 +- src/native/windows/juce_win32_Windowing.cpp | 3 +- src/text/juce_XmlDocument.cpp | 32 +- src/text/juce_XmlDocument.h | 2 +- src/text/juce_XmlElement.cpp | 5 +- src/utilities/juce_PropertiesFile.cpp | 31 +- 126 files changed, 1385 insertions(+), 1769 deletions(-) create mode 100644 src/containers/juce_ScopedPointer.h diff --git a/build/linux/JUCE.make b/build/linux/JUCE.make index 4d553c9924..f1ec774ae4 100644 --- a/build/linux/JUCE.make +++ b/build/linux/JUCE.make @@ -40,71 +40,71 @@ endif OBJECTS := \ $(OBJDIR)/juce_FileLogger.o \ - $(OBJDIR)/juce_Logger.o \ $(OBJDIR)/juce_PerformanceCounter.o \ $(OBJDIR)/juce_Random.o \ $(OBJDIR)/juce_RelativeTime.o \ $(OBJDIR)/juce_Time.o \ $(OBJDIR)/juce_Uuid.o \ $(OBJDIR)/juce_SystemStats.o \ + $(OBJDIR)/juce_Logger.o \ $(OBJDIR)/juce_BlowFish.o \ $(OBJDIR)/juce_Primes.o \ $(OBJDIR)/juce_RSAKey.o \ $(OBJDIR)/juce_MD5.o \ - $(OBJDIR)/juce_Variant.o \ - $(OBJDIR)/juce_MemoryBlock.o \ $(OBJDIR)/juce_ValueTree.o \ $(OBJDIR)/juce_PropertySet.o \ $(OBJDIR)/juce_BitArray.o \ - $(OBJDIR)/juce_DirectoryIterator.o \ - $(OBJDIR)/juce_File.o \ + $(OBJDIR)/juce_MemoryBlock.o \ + $(OBJDIR)/juce_Variant.o \ $(OBJDIR)/juce_FileInputStream.o \ + $(OBJDIR)/juce_File.o \ $(OBJDIR)/juce_FileOutputStream.o \ $(OBJDIR)/juce_FileSearchPath.o \ $(OBJDIR)/juce_NamedPipe.o \ $(OBJDIR)/juce_ZipFile.o \ - $(OBJDIR)/juce_URL.o \ + $(OBJDIR)/juce_DirectoryIterator.o \ $(OBJDIR)/juce_Socket.o \ - $(OBJDIR)/juce_BufferedInputStream.o \ + $(OBJDIR)/juce_URL.o \ $(OBJDIR)/juce_FileInputSource.o \ - $(OBJDIR)/juce_GZIPCompressorOutputStream.o \ - $(OBJDIR)/juce_GZIPDecompressorInputStream.o \ + $(OBJDIR)/juce_OutputStream.o \ $(OBJDIR)/juce_MemoryInputStream.o \ $(OBJDIR)/juce_MemoryOutputStream.o \ $(OBJDIR)/juce_SubregionStream.o \ $(OBJDIR)/juce_InputStream.o \ - $(OBJDIR)/juce_OutputStream.o \ + $(OBJDIR)/juce_GZIPCompressorOutputStream.o \ + $(OBJDIR)/juce_BufferedInputStream.o \ + $(OBJDIR)/juce_GZIPDecompressorInputStream.o \ $(OBJDIR)/juce_LocalisedStrings.o \ + $(OBJDIR)/juce_String.o \ $(OBJDIR)/juce_StringPairArray.o \ $(OBJDIR)/juce_XmlDocument.o \ - $(OBJDIR)/juce_XmlElement.o \ $(OBJDIR)/juce_CharacterFunctions.o \ - $(OBJDIR)/juce_String.o \ $(OBJDIR)/juce_StringArray.o \ + $(OBJDIR)/juce_XmlElement.o \ $(OBJDIR)/juce_InterProcessLock.o \ $(OBJDIR)/juce_ReadWriteLock.o \ $(OBJDIR)/juce_Thread.o \ $(OBJDIR)/juce_ThreadPool.o \ $(OBJDIR)/juce_TimeSliceThread.o \ - $(OBJDIR)/juce_ApplicationCommandInfo.o \ $(OBJDIR)/juce_Application.o \ - $(OBJDIR)/juce_ApplicationCommandManager.o \ + $(OBJDIR)/juce_ApplicationCommandInfo.o \ $(OBJDIR)/juce_ApplicationCommandTarget.o \ $(OBJDIR)/juce_ApplicationProperties.o \ + $(OBJDIR)/juce_ApplicationCommandManager.o \ $(OBJDIR)/juce_AudioDataConverters.o \ - $(OBJDIR)/juce_AudioSampleBuffer.o \ $(OBJDIR)/juce_IIRFilter.o \ - $(OBJDIR)/juce_MidiFile.o \ + $(OBJDIR)/juce_AudioSampleBuffer.o \ $(OBJDIR)/juce_MidiKeyboardState.o \ $(OBJDIR)/juce_MidiMessageCollector.o \ $(OBJDIR)/juce_MidiMessageSequence.o \ $(OBJDIR)/juce_MidiMessage.o \ $(OBJDIR)/juce_MidiBuffer.o \ + $(OBJDIR)/juce_MidiFile.o \ $(OBJDIR)/juce_AudioProcessor.o \ $(OBJDIR)/juce_AudioProcessorEditor.o \ - $(OBJDIR)/juce_AudioProcessorGraph.o \ $(OBJDIR)/juce_AudioProcessorPlayer.o \ $(OBJDIR)/juce_GenericAudioProcessorEditor.o \ + $(OBJDIR)/juce_AudioProcessorGraph.o \ $(OBJDIR)/juce_AudioPluginFormat.o \ $(OBJDIR)/juce_AudioPluginFormatManager.o \ $(OBJDIR)/juce_AudioPluginInstance.o \ @@ -114,16 +114,16 @@ OBJECTS := \ $(OBJDIR)/juce_PluginListComponent.o \ $(OBJDIR)/juce_VSTPluginFormat.o \ $(OBJDIR)/juce_AiffAudioFormat.o \ - $(OBJDIR)/juce_AudioThumbnail.o \ + $(OBJDIR)/juce_AudioCDReader.o \ $(OBJDIR)/juce_AudioFormatManager.o \ $(OBJDIR)/juce_AudioSubsectionReader.o \ $(OBJDIR)/juce_AudioThumbnailCache.o \ - $(OBJDIR)/juce_FlacAudioFormat.o \ - $(OBJDIR)/juce_OggVorbisAudioFormat.o \ - $(OBJDIR)/juce_QuickTimeAudioFormat.o \ $(OBJDIR)/juce_AudioFormat.o \ - $(OBJDIR)/juce_AudioCDReader.o \ + $(OBJDIR)/juce_QuickTimeAudioFormat.o \ $(OBJDIR)/juce_WavAudioFormat.o \ + $(OBJDIR)/juce_OggVorbisAudioFormat.o \ + $(OBJDIR)/juce_AudioThumbnail.o \ + $(OBJDIR)/juce_FlacAudioFormat.o \ $(OBJDIR)/juce_AudioFormatReaderSource.o \ $(OBJDIR)/juce_AudioSourcePlayer.o \ $(OBJDIR)/juce_AudioTransportSource.o \ @@ -160,12 +160,12 @@ OBJECTS := \ $(OBJDIR)/juce_Colour.o \ $(OBJDIR)/juce_ColourGradient.o \ $(OBJDIR)/juce_Justification.o \ - $(OBJDIR)/juce_EdgeTable.o \ $(OBJDIR)/juce_RectanglePlacement.o \ $(OBJDIR)/juce_Graphics.o \ - $(OBJDIR)/juce_FillType.o \ $(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o \ $(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o \ + $(OBJDIR)/juce_EdgeTable.o \ + $(OBJDIR)/juce_FillType.o \ $(OBJDIR)/juce_DrawableComposite.o \ $(OBJDIR)/juce_Drawable.o \ $(OBJDIR)/juce_DrawablePath.o \ @@ -175,27 +175,27 @@ OBJECTS := \ $(OBJDIR)/juce_GlowEffect.o \ $(OBJDIR)/juce_ReduceOpacityEffect.o \ $(OBJDIR)/juce_DropShadowEffect.o \ - $(OBJDIR)/juce_TextLayout.o \ $(OBJDIR)/juce_Font.o \ $(OBJDIR)/juce_Typeface.o \ $(OBJDIR)/juce_GlyphArrangement.o \ + $(OBJDIR)/juce_TextLayout.o \ + $(OBJDIR)/juce_Path.o \ $(OBJDIR)/juce_BorderSize.o \ $(OBJDIR)/juce_Line.o \ + $(OBJDIR)/juce_PathStrokeType.o \ $(OBJDIR)/juce_AffineTransform.o \ $(OBJDIR)/juce_Point.o \ $(OBJDIR)/juce_PositionedRectangle.o \ $(OBJDIR)/juce_RectangleList.o \ - $(OBJDIR)/juce_PathStrokeType.o \ $(OBJDIR)/juce_Rectangle.o \ - $(OBJDIR)/juce_Path.o \ $(OBJDIR)/juce_PathIterator.o \ $(OBJDIR)/juce_ImageCache.o \ - $(OBJDIR)/juce_ImageFileFormat.o \ $(OBJDIR)/juce_Image.o \ + $(OBJDIR)/juce_ImageFileFormat.o \ $(OBJDIR)/juce_ImageConvolutionKernel.o \ + $(OBJDIR)/juce_GIFLoader.o \ $(OBJDIR)/juce_JPEGLoader.o \ $(OBJDIR)/juce_PNGLoader.o \ - $(OBJDIR)/juce_GIFLoader.o \ $(OBJDIR)/juce_ComponentListener.o \ $(OBJDIR)/juce_Desktop.o \ $(OBJDIR)/juce_Component.o \ @@ -205,45 +205,44 @@ OBJECTS := \ $(OBJDIR)/juce_ImageButton.o \ $(OBJDIR)/juce_TextButton.o \ $(OBJDIR)/juce_ToggleButton.o \ - $(OBJDIR)/juce_DrawableButton.o \ - $(OBJDIR)/juce_ToolbarButton.o \ $(OBJDIR)/juce_ShapeButton.o \ - $(OBJDIR)/juce_Label.o \ - $(OBJDIR)/juce_TreeView.o \ - $(OBJDIR)/juce_TableHeaderComponent.o \ + $(OBJDIR)/juce_ToolbarButton.o \ + $(OBJDIR)/juce_DrawableButton.o \ + $(OBJDIR)/juce_TableListBox.o \ + $(OBJDIR)/juce_TextEditor.o \ $(OBJDIR)/juce_ProgressBar.o \ $(OBJDIR)/juce_ToolbarItemPalette.o \ - $(OBJDIR)/juce_TableListBox.o \ $(OBJDIR)/juce_Slider.o \ - $(OBJDIR)/juce_TextEditor.o \ - $(OBJDIR)/juce_ComboBox.o \ - $(OBJDIR)/juce_ListBox.o \ $(OBJDIR)/juce_Toolbar.o \ + $(OBJDIR)/juce_ListBox.o \ + $(OBJDIR)/juce_TreeView.o \ $(OBJDIR)/juce_ToolbarItemComponent.o \ + $(OBJDIR)/juce_ComboBox.o \ + $(OBJDIR)/juce_TableHeaderComponent.o \ + $(OBJDIR)/juce_Label.o \ + $(OBJDIR)/juce_CodeDocument.o \ $(OBJDIR)/juce_CPlusPlusCodeTokeniser.o \ $(OBJDIR)/juce_CodeEditorComponent.o \ - $(OBJDIR)/juce_CodeDocument.o \ $(OBJDIR)/juce_DirectoryContentsDisplayComponent.o \ - $(OBJDIR)/juce_DirectoryContentsList.o \ - $(OBJDIR)/juce_FileBrowserComponent.o \ $(OBJDIR)/juce_FileFilter.o \ $(OBJDIR)/juce_FileListComponent.o \ - $(OBJDIR)/juce_FileChooser.o \ - $(OBJDIR)/juce_FileTreeComponent.o \ $(OBJDIR)/juce_FilenameComponent.o \ - $(OBJDIR)/juce_ImagePreviewComponent.o \ $(OBJDIR)/juce_FileChooserDialogBox.o \ $(OBJDIR)/juce_FileSearchPathListComponent.o \ $(OBJDIR)/juce_WildcardFileFilter.o \ + $(OBJDIR)/juce_ImagePreviewComponent.o \ + $(OBJDIR)/juce_FileTreeComponent.o \ + $(OBJDIR)/juce_FileChooser.o \ + $(OBJDIR)/juce_DirectoryContentsList.o \ + $(OBJDIR)/juce_FileBrowserComponent.o \ $(OBJDIR)/juce_KeyListener.o \ - $(OBJDIR)/juce_KeyMappingEditorComponent.o \ - $(OBJDIR)/juce_KeyPressMappingSet.o \ + $(OBJDIR)/juce_KeyPress.o \ $(OBJDIR)/juce_KeyboardFocusTraverser.o \ $(OBJDIR)/juce_ModifierKeys.o \ - $(OBJDIR)/juce_KeyPress.o \ + $(OBJDIR)/juce_KeyPressMappingSet.o \ + $(OBJDIR)/juce_KeyMappingEditorComponent.o \ $(OBJDIR)/juce_ComponentAnimator.o \ $(OBJDIR)/juce_ComponentBoundsConstrainer.o \ - $(OBJDIR)/juce_ComponentMovementWatcher.o \ $(OBJDIR)/juce_GroupComponent.o \ $(OBJDIR)/juce_MultiDocumentPanel.o \ $(OBJDIR)/juce_ResizableBorderComponent.o \ @@ -255,11 +254,12 @@ OBJECTS := \ $(OBJDIR)/juce_TabbedButtonBar.o \ $(OBJDIR)/juce_TabbedComponent.o \ $(OBJDIR)/juce_Viewport.o \ + $(OBJDIR)/juce_ComponentMovementWatcher.o \ $(OBJDIR)/juce_LookAndFeel.o \ $(OBJDIR)/juce_OldSchoolLookAndFeel.o \ $(OBJDIR)/juce_MenuBarModel.o \ - $(OBJDIR)/juce_MenuBarComponent.o \ $(OBJDIR)/juce_PopupMenu.o \ + $(OBJDIR)/juce_MenuBarComponent.o \ $(OBJDIR)/juce_ComponentDragger.o \ $(OBJDIR)/juce_DragAndDropContainer.o \ $(OBJDIR)/juce_MouseEvent.o \ @@ -276,22 +276,22 @@ OBJECTS := \ $(OBJDIR)/juce_AudioDeviceSelectorComponent.o \ $(OBJDIR)/juce_BubbleMessageComponent.o \ $(OBJDIR)/juce_DropShadower.o \ - $(OBJDIR)/juce_MagnifierComponent.o \ + $(OBJDIR)/juce_OpenGLComponent.o \ $(OBJDIR)/juce_PreferencesPanel.o \ $(OBJDIR)/juce_SystemTrayIconComponent.o \ - $(OBJDIR)/juce_OpenGLComponent.o \ - $(OBJDIR)/juce_MidiKeyboardComponent.o \ $(OBJDIR)/juce_BubbleComponent.o \ + $(OBJDIR)/juce_MidiKeyboardComponent.o \ + $(OBJDIR)/juce_MagnifierComponent.o \ $(OBJDIR)/juce_ColourSelector.o \ $(OBJDIR)/juce_AlertWindow.o \ $(OBJDIR)/juce_DialogWindow.o \ - $(OBJDIR)/juce_DocumentWindow.o \ $(OBJDIR)/juce_ResizableWindow.o \ - $(OBJDIR)/juce_SplashScreen.o \ - $(OBJDIR)/juce_ThreadWithProgressWindow.o \ $(OBJDIR)/juce_TooltipWindow.o \ + $(OBJDIR)/juce_ThreadWithProgressWindow.o \ + $(OBJDIR)/juce_DocumentWindow.o \ $(OBJDIR)/juce_TopLevelWindow.o \ $(OBJDIR)/juce_ComponentPeer.o \ + $(OBJDIR)/juce_SplashScreen.o \ $(OBJDIR)/juce_linux_Midi.o \ $(OBJDIR)/juce_linux_Network.o \ $(OBJDIR)/juce_linux_FileChooser.o \ @@ -300,11 +300,11 @@ OBJECTS := \ $(OBJDIR)/juce_linux_Fonts.o \ $(OBJDIR)/juce_linux_SystemStats.o \ $(OBJDIR)/juce_linux_WebBrowserComponent.o \ - $(OBJDIR)/juce_linux_Audio.o \ - $(OBJDIR)/juce_linux_Windowing.o \ $(OBJDIR)/juce_linux_JackAudio.o \ + $(OBJDIR)/juce_linux_Audio.o \ $(OBJDIR)/juce_linux_AudioCDReader.o \ $(OBJDIR)/juce_linux_Files.o \ + $(OBJDIR)/juce_linux_Windowing.o \ $(OBJDIR)/juce_linux_NativeCode.o \ MKDIR_TYPE := msdos @@ -352,11 +352,6 @@ $(OBJDIR)/juce_FileLogger.o: ../../src/core/juce_FileLogger.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Logger.o: ../../src/core/juce_Logger.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_PerformanceCounter.o: ../../src/core/juce_PerformanceCounter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -387,6 +382,11 @@ $(OBJDIR)/juce_SystemStats.o: ../../src/core/juce_SystemStats.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_Logger.o: ../../src/core/juce_Logger.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_BlowFish.o: ../../src/cryptography/juce_BlowFish.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -407,32 +407,32 @@ $(OBJDIR)/juce_MD5.o: ../../src/cryptography/juce_MD5.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Variant.o: ../../src/containers/juce_Variant.cpp +$(OBJDIR)/juce_ValueTree.o: ../../src/containers/juce_ValueTree.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_MemoryBlock.o: ../../src/containers/juce_MemoryBlock.cpp +$(OBJDIR)/juce_PropertySet.o: ../../src/containers/juce_PropertySet.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ValueTree.o: ../../src/containers/juce_ValueTree.cpp +$(OBJDIR)/juce_BitArray.o: ../../src/containers/juce_BitArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PropertySet.o: ../../src/containers/juce_PropertySet.cpp +$(OBJDIR)/juce_MemoryBlock.o: ../../src/containers/juce_MemoryBlock.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_BitArray.o: ../../src/containers/juce_BitArray.cpp +$(OBJDIR)/juce_Variant.o: ../../src/containers/juce_Variant.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DirectoryIterator.o: ../../src/io/files/juce_DirectoryIterator.cpp +$(OBJDIR)/juce_FileInputStream.o: ../../src/io/files/juce_FileInputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -442,11 +442,6 @@ $(OBJDIR)/juce_File.o: ../../src/io/files/juce_File.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FileInputStream.o: ../../src/io/files/juce_FileInputStream.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_FileOutputStream.o: ../../src/io/files/juce_FileOutputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -467,7 +462,7 @@ $(OBJDIR)/juce_ZipFile.o: ../../src/io/files/juce_ZipFile.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_URL.o: ../../src/io/network/juce_URL.cpp +$(OBJDIR)/juce_DirectoryIterator.o: ../../src/io/files/juce_DirectoryIterator.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -477,7 +472,7 @@ $(OBJDIR)/juce_Socket.o: ../../src/io/network/juce_Socket.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_BufferedInputStream.o: ../../src/io/streams/juce_BufferedInputStream.cpp +$(OBJDIR)/juce_URL.o: ../../src/io/network/juce_URL.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -487,12 +482,7 @@ $(OBJDIR)/juce_FileInputSource.o: ../../src/io/streams/juce_FileInputSource.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_GZIPCompressorOutputStream.o: ../../src/io/streams/juce_GZIPCompressorOutputStream.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_GZIPDecompressorInputStream.o: ../../src/io/streams/juce_GZIPDecompressorInputStream.cpp +$(OBJDIR)/juce_OutputStream.o: ../../src/io/streams/juce_OutputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -517,7 +507,17 @@ $(OBJDIR)/juce_InputStream.o: ../../src/io/streams/juce_InputStream.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_OutputStream.o: ../../src/io/streams/juce_OutputStream.cpp +$(OBJDIR)/juce_GZIPCompressorOutputStream.o: ../../src/io/streams/juce_GZIPCompressorOutputStream.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_BufferedInputStream.o: ../../src/io/streams/juce_BufferedInputStream.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_GZIPDecompressorInputStream.o: ../../src/io/streams/juce_GZIPDecompressorInputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -527,17 +527,17 @@ $(OBJDIR)/juce_LocalisedStrings.o: ../../src/text/juce_LocalisedStrings.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_StringPairArray.o: ../../src/text/juce_StringPairArray.cpp +$(OBJDIR)/juce_String.o: ../../src/text/juce_String.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_XmlDocument.o: ../../src/text/juce_XmlDocument.cpp +$(OBJDIR)/juce_StringPairArray.o: ../../src/text/juce_StringPairArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_XmlElement.o: ../../src/text/juce_XmlElement.cpp +$(OBJDIR)/juce_XmlDocument.o: ../../src/text/juce_XmlDocument.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -547,12 +547,12 @@ $(OBJDIR)/juce_CharacterFunctions.o: ../../src/text/juce_CharacterFunctions.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_String.o: ../../src/text/juce_String.cpp +$(OBJDIR)/juce_StringArray.o: ../../src/text/juce_StringArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_StringArray.o: ../../src/text/juce_StringArray.cpp +$(OBJDIR)/juce_XmlElement.o: ../../src/text/juce_XmlElement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -582,17 +582,12 @@ $(OBJDIR)/juce_TimeSliceThread.o: ../../src/threads/juce_TimeSliceThread.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ApplicationCommandInfo.o: ../../src/application/juce_ApplicationCommandInfo.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_Application.o: ../../src/application/juce_Application.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ApplicationCommandManager.o: ../../src/application/juce_ApplicationCommandManager.cpp +$(OBJDIR)/juce_ApplicationCommandInfo.o: ../../src/application/juce_ApplicationCommandInfo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -607,12 +602,12 @@ $(OBJDIR)/juce_ApplicationProperties.o: ../../src/application/juce_ApplicationPr @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioDataConverters.o: ../../src/audio/dsp/juce_AudioDataConverters.cpp +$(OBJDIR)/juce_ApplicationCommandManager.o: ../../src/application/juce_ApplicationCommandManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioSampleBuffer.o: ../../src/audio/dsp/juce_AudioSampleBuffer.cpp +$(OBJDIR)/juce_AudioDataConverters.o: ../../src/audio/dsp/juce_AudioDataConverters.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -622,7 +617,7 @@ $(OBJDIR)/juce_IIRFilter.o: ../../src/audio/dsp/juce_IIRFilter.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_MidiFile.o: ../../src/audio/midi/juce_MidiFile.cpp +$(OBJDIR)/juce_AudioSampleBuffer.o: ../../src/audio/dsp/juce_AudioSampleBuffer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -652,17 +647,17 @@ $(OBJDIR)/juce_MidiBuffer.o: ../../src/audio/midi/juce_MidiBuffer.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioProcessor.o: ../../src/audio/processors/juce_AudioProcessor.cpp +$(OBJDIR)/juce_MidiFile.o: ../../src/audio/midi/juce_MidiFile.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioProcessorEditor.o: ../../src/audio/processors/juce_AudioProcessorEditor.cpp +$(OBJDIR)/juce_AudioProcessor.o: ../../src/audio/processors/juce_AudioProcessor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioProcessorGraph.o: ../../src/audio/processors/juce_AudioProcessorGraph.cpp +$(OBJDIR)/juce_AudioProcessorEditor.o: ../../src/audio/processors/juce_AudioProcessorEditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -677,6 +672,11 @@ $(OBJDIR)/juce_GenericAudioProcessorEditor.o: ../../src/audio/processors/juce_Ge @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_AudioProcessorGraph.o: ../../src/audio/processors/juce_AudioProcessorGraph.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_AudioPluginFormat.o: ../../src/audio/plugins/juce_AudioPluginFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -722,7 +722,7 @@ $(OBJDIR)/juce_AiffAudioFormat.o: ../../src/audio/audio_file_formats/juce_AiffAu @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioThumbnail.o: ../../src/audio/audio_file_formats/juce_AudioThumbnail.cpp +$(OBJDIR)/juce_AudioCDReader.o: ../../src/audio/audio_file_formats/juce_AudioCDReader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -742,32 +742,32 @@ $(OBJDIR)/juce_AudioThumbnailCache.o: ../../src/audio/audio_file_formats/juce_Au @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FlacAudioFormat.o: ../../src/audio/audio_file_formats/juce_FlacAudioFormat.cpp +$(OBJDIR)/juce_AudioFormat.o: ../../src/audio/audio_file_formats/juce_AudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_OggVorbisAudioFormat.o: ../../src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp +$(OBJDIR)/juce_QuickTimeAudioFormat.o: ../../src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_QuickTimeAudioFormat.o: ../../src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp +$(OBJDIR)/juce_WavAudioFormat.o: ../../src/audio/audio_file_formats/juce_WavAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioFormat.o: ../../src/audio/audio_file_formats/juce_AudioFormat.cpp +$(OBJDIR)/juce_OggVorbisAudioFormat.o: ../../src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioCDReader.o: ../../src/audio/audio_file_formats/juce_AudioCDReader.cpp +$(OBJDIR)/juce_AudioThumbnail.o: ../../src/audio/audio_file_formats/juce_AudioThumbnail.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_WavAudioFormat.o: ../../src/audio/audio_file_formats/juce_WavAudioFormat.cpp +$(OBJDIR)/juce_FlacAudioFormat.o: ../../src/audio/audio_file_formats/juce_FlacAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -952,32 +952,32 @@ $(OBJDIR)/juce_Justification.o: ../../src/gui/graphics/contexts/juce_Justificati @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_EdgeTable.o: ../../src/gui/graphics/contexts/juce_EdgeTable.cpp +$(OBJDIR)/juce_RectanglePlacement.o: ../../src/gui/graphics/contexts/juce_RectanglePlacement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_RectanglePlacement.o: ../../src/gui/graphics/contexts/juce_RectanglePlacement.cpp +$(OBJDIR)/juce_Graphics.o: ../../src/gui/graphics/contexts/juce_Graphics.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Graphics.o: ../../src/gui/graphics/contexts/juce_Graphics.cpp +$(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o: ../../src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FillType.o: ../../src/gui/graphics/contexts/juce_FillType.cpp +$(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o: ../../src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o: ../../src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +$(OBJDIR)/juce_EdgeTable.o: ../../src/gui/graphics/contexts/juce_EdgeTable.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o: ../../src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +$(OBJDIR)/juce_FillType.o: ../../src/gui/graphics/contexts/juce_FillType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1027,67 +1027,67 @@ $(OBJDIR)/juce_DropShadowEffect.o: ../../src/gui/graphics/effects/juce_DropShado @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TextLayout.o: ../../src/gui/graphics/fonts/juce_TextLayout.cpp +$(OBJDIR)/juce_Font.o: ../../src/gui/graphics/fonts/juce_Font.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Font.o: ../../src/gui/graphics/fonts/juce_Font.cpp +$(OBJDIR)/juce_Typeface.o: ../../src/gui/graphics/fonts/juce_Typeface.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Typeface.o: ../../src/gui/graphics/fonts/juce_Typeface.cpp +$(OBJDIR)/juce_GlyphArrangement.o: ../../src/gui/graphics/fonts/juce_GlyphArrangement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_GlyphArrangement.o: ../../src/gui/graphics/fonts/juce_GlyphArrangement.cpp +$(OBJDIR)/juce_TextLayout.o: ../../src/gui/graphics/fonts/juce_TextLayout.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_BorderSize.o: ../../src/gui/graphics/geometry/juce_BorderSize.cpp +$(OBJDIR)/juce_Path.o: ../../src/gui/graphics/geometry/juce_Path.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Line.o: ../../src/gui/graphics/geometry/juce_Line.cpp +$(OBJDIR)/juce_BorderSize.o: ../../src/gui/graphics/geometry/juce_BorderSize.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AffineTransform.o: ../../src/gui/graphics/geometry/juce_AffineTransform.cpp +$(OBJDIR)/juce_Line.o: ../../src/gui/graphics/geometry/juce_Line.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Point.o: ../../src/gui/graphics/geometry/juce_Point.cpp +$(OBJDIR)/juce_PathStrokeType.o: ../../src/gui/graphics/geometry/juce_PathStrokeType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PositionedRectangle.o: ../../src/gui/graphics/geometry/juce_PositionedRectangle.cpp +$(OBJDIR)/juce_AffineTransform.o: ../../src/gui/graphics/geometry/juce_AffineTransform.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_RectangleList.o: ../../src/gui/graphics/geometry/juce_RectangleList.cpp +$(OBJDIR)/juce_Point.o: ../../src/gui/graphics/geometry/juce_Point.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PathStrokeType.o: ../../src/gui/graphics/geometry/juce_PathStrokeType.cpp +$(OBJDIR)/juce_PositionedRectangle.o: ../../src/gui/graphics/geometry/juce_PositionedRectangle.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Rectangle.o: ../../src/gui/graphics/geometry/juce_Rectangle.cpp +$(OBJDIR)/juce_RectangleList.o: ../../src/gui/graphics/geometry/juce_RectangleList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Path.o: ../../src/gui/graphics/geometry/juce_Path.cpp +$(OBJDIR)/juce_Rectangle.o: ../../src/gui/graphics/geometry/juce_Rectangle.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1102,12 +1102,12 @@ $(OBJDIR)/juce_ImageCache.o: ../../src/gui/graphics/imaging/juce_ImageCache.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ImageFileFormat.o: ../../src/gui/graphics/imaging/juce_ImageFileFormat.cpp +$(OBJDIR)/juce_Image.o: ../../src/gui/graphics/imaging/juce_Image.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Image.o: ../../src/gui/graphics/imaging/juce_Image.cpp +$(OBJDIR)/juce_ImageFileFormat.o: ../../src/gui/graphics/imaging/juce_ImageFileFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1117,17 +1117,17 @@ $(OBJDIR)/juce_ImageConvolutionKernel.o: ../../src/gui/graphics/imaging/juce_Ima @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_JPEGLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp +$(OBJDIR)/juce_GIFLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PNGLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp +$(OBJDIR)/juce_JPEGLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_GIFLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp +$(OBJDIR)/juce_PNGLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1177,7 +1177,7 @@ $(OBJDIR)/juce_ToggleButton.o: ../../src/gui/components/buttons/juce_ToggleButto @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DrawableButton.o: ../../src/gui/components/buttons/juce_DrawableButton.cpp +$(OBJDIR)/juce_ShapeButton.o: ../../src/gui/components/buttons/juce_ShapeButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1187,22 +1187,17 @@ $(OBJDIR)/juce_ToolbarButton.o: ../../src/gui/components/buttons/juce_ToolbarBut @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ShapeButton.o: ../../src/gui/components/buttons/juce_ShapeButton.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_Label.o: ../../src/gui/components/controls/juce_Label.cpp +$(OBJDIR)/juce_DrawableButton.o: ../../src/gui/components/buttons/juce_DrawableButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TreeView.o: ../../src/gui/components/controls/juce_TreeView.cpp +$(OBJDIR)/juce_TableListBox.o: ../../src/gui/components/controls/juce_TableListBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TableHeaderComponent.o: ../../src/gui/components/controls/juce_TableHeaderComponent.cpp +$(OBJDIR)/juce_TextEditor.o: ../../src/gui/components/controls/juce_TextEditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1217,47 +1212,42 @@ $(OBJDIR)/juce_ToolbarItemPalette.o: ../../src/gui/components/controls/juce_Tool @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TableListBox.o: ../../src/gui/components/controls/juce_TableListBox.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_Slider.o: ../../src/gui/components/controls/juce_Slider.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TextEditor.o: ../../src/gui/components/controls/juce_TextEditor.cpp +$(OBJDIR)/juce_Toolbar.o: ../../src/gui/components/controls/juce_Toolbar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ComboBox.o: ../../src/gui/components/controls/juce_ComboBox.cpp +$(OBJDIR)/juce_ListBox.o: ../../src/gui/components/controls/juce_ListBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ListBox.o: ../../src/gui/components/controls/juce_ListBox.cpp +$(OBJDIR)/juce_TreeView.o: ../../src/gui/components/controls/juce_TreeView.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Toolbar.o: ../../src/gui/components/controls/juce_Toolbar.cpp +$(OBJDIR)/juce_ToolbarItemComponent.o: ../../src/gui/components/controls/juce_ToolbarItemComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ToolbarItemComponent.o: ../../src/gui/components/controls/juce_ToolbarItemComponent.cpp +$(OBJDIR)/juce_ComboBox.o: ../../src/gui/components/controls/juce_ComboBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_CPlusPlusCodeTokeniser.o: ../../src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp +$(OBJDIR)/juce_TableHeaderComponent.o: ../../src/gui/components/controls/juce_TableHeaderComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_CodeEditorComponent.o: ../../src/gui/components/code_editor/juce_CodeEditorComponent.cpp +$(OBJDIR)/juce_Label.o: ../../src/gui/components/controls/juce_Label.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1267,17 +1257,17 @@ $(OBJDIR)/juce_CodeDocument.o: ../../src/gui/components/code_editor/juce_CodeDoc @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DirectoryContentsDisplayComponent.o: ../../src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp +$(OBJDIR)/juce_CPlusPlusCodeTokeniser.o: ../../src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DirectoryContentsList.o: ../../src/gui/components/filebrowser/juce_DirectoryContentsList.cpp +$(OBJDIR)/juce_CodeEditorComponent.o: ../../src/gui/components/code_editor/juce_CodeEditorComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FileBrowserComponent.o: ../../src/gui/components/filebrowser/juce_FileBrowserComponent.cpp +$(OBJDIR)/juce_DirectoryContentsDisplayComponent.o: ../../src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1292,17 +1282,22 @@ $(OBJDIR)/juce_FileListComponent.o: ../../src/gui/components/filebrowser/juce_Fi @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FileChooser.o: ../../src/gui/components/filebrowser/juce_FileChooser.cpp +$(OBJDIR)/juce_FilenameComponent.o: ../../src/gui/components/filebrowser/juce_FilenameComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FileTreeComponent.o: ../../src/gui/components/filebrowser/juce_FileTreeComponent.cpp +$(OBJDIR)/juce_FileChooserDialogBox.o: ../../src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FilenameComponent.o: ../../src/gui/components/filebrowser/juce_FilenameComponent.cpp +$(OBJDIR)/juce_FileSearchPathListComponent.o: ../../src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_WildcardFileFilter.o: ../../src/gui/components/filebrowser/juce_WildcardFileFilter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1312,32 +1307,32 @@ $(OBJDIR)/juce_ImagePreviewComponent.o: ../../src/gui/components/filebrowser/juc @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FileChooserDialogBox.o: ../../src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp +$(OBJDIR)/juce_FileTreeComponent.o: ../../src/gui/components/filebrowser/juce_FileTreeComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FileSearchPathListComponent.o: ../../src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp +$(OBJDIR)/juce_FileChooser.o: ../../src/gui/components/filebrowser/juce_FileChooser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_WildcardFileFilter.o: ../../src/gui/components/filebrowser/juce_WildcardFileFilter.cpp +$(OBJDIR)/juce_DirectoryContentsList.o: ../../src/gui/components/filebrowser/juce_DirectoryContentsList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_KeyListener.o: ../../src/gui/components/keyboard/juce_KeyListener.cpp +$(OBJDIR)/juce_FileBrowserComponent.o: ../../src/gui/components/filebrowser/juce_FileBrowserComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_KeyMappingEditorComponent.o: ../../src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp +$(OBJDIR)/juce_KeyListener.o: ../../src/gui/components/keyboard/juce_KeyListener.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_KeyPressMappingSet.o: ../../src/gui/components/keyboard/juce_KeyPressMappingSet.cpp +$(OBJDIR)/juce_KeyPress.o: ../../src/gui/components/keyboard/juce_KeyPress.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1352,22 +1347,22 @@ $(OBJDIR)/juce_ModifierKeys.o: ../../src/gui/components/keyboard/juce_ModifierKe @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_KeyPress.o: ../../src/gui/components/keyboard/juce_KeyPress.cpp +$(OBJDIR)/juce_KeyPressMappingSet.o: ../../src/gui/components/keyboard/juce_KeyPressMappingSet.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ComponentAnimator.o: ../../src/gui/components/layout/juce_ComponentAnimator.cpp +$(OBJDIR)/juce_KeyMappingEditorComponent.o: ../../src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ComponentBoundsConstrainer.o: ../../src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp +$(OBJDIR)/juce_ComponentAnimator.o: ../../src/gui/components/layout/juce_ComponentAnimator.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ComponentMovementWatcher.o: ../../src/gui/components/layout/juce_ComponentMovementWatcher.cpp +$(OBJDIR)/juce_ComponentBoundsConstrainer.o: ../../src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1427,6 +1422,11 @@ $(OBJDIR)/juce_Viewport.o: ../../src/gui/components/layout/juce_Viewport.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_ComponentMovementWatcher.o: ../../src/gui/components/layout/juce_ComponentMovementWatcher.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_LookAndFeel.o: ../../src/gui/components/lookandfeel/juce_LookAndFeel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1442,12 +1442,12 @@ $(OBJDIR)/juce_MenuBarModel.o: ../../src/gui/components/menus/juce_MenuBarModel. @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_MenuBarComponent.o: ../../src/gui/components/menus/juce_MenuBarComponent.cpp +$(OBJDIR)/juce_PopupMenu.o: ../../src/gui/components/menus/juce_PopupMenu.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PopupMenu.o: ../../src/gui/components/menus/juce_PopupMenu.cpp +$(OBJDIR)/juce_MenuBarComponent.o: ../../src/gui/components/menus/juce_MenuBarComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1532,7 +1532,7 @@ $(OBJDIR)/juce_DropShadower.o: ../../src/gui/components/special/juce_DropShadowe @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_MagnifierComponent.o: ../../src/gui/components/special/juce_MagnifierComponent.cpp +$(OBJDIR)/juce_OpenGLComponent.o: ../../src/gui/components/special/juce_OpenGLComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1547,7 +1547,7 @@ $(OBJDIR)/juce_SystemTrayIconComponent.o: ../../src/gui/components/special/juce_ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_OpenGLComponent.o: ../../src/gui/components/special/juce_OpenGLComponent.cpp +$(OBJDIR)/juce_BubbleComponent.o: ../../src/gui/components/special/juce_BubbleComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1557,7 +1557,7 @@ $(OBJDIR)/juce_MidiKeyboardComponent.o: ../../src/gui/components/special/juce_Mi @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_BubbleComponent.o: ../../src/gui/components/special/juce_BubbleComponent.cpp +$(OBJDIR)/juce_MagnifierComponent.o: ../../src/gui/components/special/juce_MagnifierComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1577,17 +1577,12 @@ $(OBJDIR)/juce_DialogWindow.o: ../../src/gui/components/windows/juce_DialogWindo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DocumentWindow.o: ../../src/gui/components/windows/juce_DocumentWindow.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_ResizableWindow.o: ../../src/gui/components/windows/juce_ResizableWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_SplashScreen.o: ../../src/gui/components/windows/juce_SplashScreen.cpp +$(OBJDIR)/juce_TooltipWindow.o: ../../src/gui/components/windows/juce_TooltipWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1597,7 +1592,7 @@ $(OBJDIR)/juce_ThreadWithProgressWindow.o: ../../src/gui/components/windows/juce @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TooltipWindow.o: ../../src/gui/components/windows/juce_TooltipWindow.cpp +$(OBJDIR)/juce_DocumentWindow.o: ../../src/gui/components/windows/juce_DocumentWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1612,6 +1607,11 @@ $(OBJDIR)/juce_ComponentPeer.o: ../../src/gui/components/windows/juce_ComponentP @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_SplashScreen.o: ../../src/gui/components/windows/juce_SplashScreen.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_linux_Midi.o: ../../src/native/linux/juce_linux_Midi.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1652,27 +1652,27 @@ $(OBJDIR)/juce_linux_WebBrowserComponent.o: ../../src/native/linux/juce_linux_We @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Audio.o: ../../src/native/linux/juce_linux_Audio.cpp +$(OBJDIR)/juce_linux_JackAudio.o: ../../src/native/linux/juce_linux_JackAudio.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Windowing.o: ../../src/native/linux/juce_linux_Windowing.cpp +$(OBJDIR)/juce_linux_Audio.o: ../../src/native/linux/juce_linux_Audio.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_JackAudio.o: ../../src/native/linux/juce_linux_JackAudio.cpp +$(OBJDIR)/juce_linux_AudioCDReader.o: ../../src/native/linux/juce_linux_AudioCDReader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_AudioCDReader.o: ../../src/native/linux/juce_linux_AudioCDReader.cpp +$(OBJDIR)/juce_linux_Files.o: ../../src/native/linux/juce_linux_Files.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Files.o: ../../src/native/linux/juce_linux_Files.cpp +$(OBJDIR)/juce_linux_Windowing.o: ../../src/native/linux/juce_linux_Windowing.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" diff --git a/build/macosx/Juce.xcodeproj/project.pbxproj b/build/macosx/Juce.xcodeproj/project.pbxproj index ac6496edaa..478143835b 100644 --- a/build/macosx/Juce.xcodeproj/project.pbxproj +++ b/build/macosx/Juce.xcodeproj/project.pbxproj @@ -651,6 +651,8 @@ 84AB91FF10A078190048FC39 /* juce_CPlusPlusCodeTokeniser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84AB91F910A078190048FC39 /* juce_CPlusPlusCodeTokeniser.cpp */; }; 84AB920010A078190048FC39 /* juce_CPlusPlusCodeTokeniser.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AB91FA10A078190048FC39 /* juce_CPlusPlusCodeTokeniser.h */; }; 84AB927210A082E30048FC39 /* juce_CodeTokeniser.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AB927110A082E30048FC39 /* juce_CodeTokeniser.h */; }; + 84AF3FE810EF9FF30035D74F /* juce_ScopedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AF3FE710EF9FF30035D74F /* juce_ScopedPointer.h */; }; + 84AF419B10F0008E0035D74F /* juce_ScopedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AF3FE710EF9FF30035D74F /* juce_ScopedPointer.h */; }; 84B2053E10D535EC008B4A79 /* juce_ValueTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 843D4A3A10D3C54500624BA6 /* juce_ValueTree.h */; }; 84B2053F10D535EC008B4A79 /* juce_ValueTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 843D4A3910D3C54500624BA6 /* juce_ValueTree.cpp */; }; 84D0F00C109B1546007F73A3 /* juce_mac_CoreGraphicsContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D0F00B109B1546007F73A3 /* juce_mac_CoreGraphicsContext.mm */; }; @@ -1261,6 +1263,7 @@ 84AB91F910A078190048FC39 /* juce_CPlusPlusCodeTokeniser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_CPlusPlusCodeTokeniser.cpp; path = components/code_editor/juce_CPlusPlusCodeTokeniser.cpp; sourceTree = ""; }; 84AB91FA10A078190048FC39 /* juce_CPlusPlusCodeTokeniser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_CPlusPlusCodeTokeniser.h; path = components/code_editor/juce_CPlusPlusCodeTokeniser.h; sourceTree = ""; }; 84AB927110A082E30048FC39 /* juce_CodeTokeniser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_CodeTokeniser.h; path = components/code_editor/juce_CodeTokeniser.h; sourceTree = ""; }; + 84AF3FE710EF9FF30035D74F /* juce_ScopedPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_ScopedPointer.h; sourceTree = ""; }; 84D0F00B109B1546007F73A3 /* juce_mac_CoreGraphicsContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_CoreGraphicsContext.mm; sourceTree = ""; }; 84DEDD9E10EE496500909D01 /* juce_HeapBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_HeapBlock.h; sourceTree = ""; }; 84F1E6DC10403605006A1807 /* juce_Application.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Application.cpp; path = ../../src/application/juce_Application.cpp; sourceTree = SOURCE_ROOT; }; @@ -2170,6 +2173,7 @@ 84F1E8D910403671006A1807 /* juce_PropertySet.h */, 84F1E8DA10403671006A1807 /* juce_ReferenceCountedArray.h */, 84F1E8DB10403671006A1807 /* juce_ReferenceCountedObject.h */, + 84AF3FE710EF9FF30035D74F /* juce_ScopedPointer.h */, 84F1E8DC10403671006A1807 /* juce_SortedSet.h */, 84F1E8DD10403671006A1807 /* juce_SparseSet.h */, 843D4A3910D3C54500624BA6 /* juce_ValueTree.cpp */, @@ -2219,19 +2223,19 @@ 84F1E9251040369C006A1807 /* utilities */ = { isa = PBXGroup; children = ( - 84F1E9261040369C006A1807 /* juce_UndoManager.h */, - 84F1E9271040369C006A1807 /* juce_SystemClipboard.h */, - 84F1E9281040369C006A1807 /* juce_UndoManager.cpp */, - 84F1E9291040369C006A1807 /* juce_PropertiesFile.h */, - 84F1E92A1040369C006A1807 /* juce_UndoableAction.h */, - 84F1E92B1040369C006A1807 /* juce_SelectedItemSet.h */, + 84F1E9321040369C006A1807 /* juce_DeletedAtShutdown.cpp */, 84F1E92C1040369C006A1807 /* juce_DeletedAtShutdown.h */, - 84F1E92D1040369C006A1807 /* juce_PropertiesFile.cpp */, - 84F1E92E1040369C006A1807 /* juce_RecentlyOpenedFilesList.h */, + 84F1E9311040369C006A1807 /* juce_FileBasedDocument.cpp */, 84F1E92F1040369C006A1807 /* juce_FileBasedDocument.h */, + 84F1E92D1040369C006A1807 /* juce_PropertiesFile.cpp */, + 84F1E9291040369C006A1807 /* juce_PropertiesFile.h */, 84F1E9301040369C006A1807 /* juce_RecentlyOpenedFilesList.cpp */, - 84F1E9311040369C006A1807 /* juce_FileBasedDocument.cpp */, - 84F1E9321040369C006A1807 /* juce_DeletedAtShutdown.cpp */, + 84F1E92E1040369C006A1807 /* juce_RecentlyOpenedFilesList.h */, + 84F1E92B1040369C006A1807 /* juce_SelectedItemSet.h */, + 84F1E9271040369C006A1807 /* juce_SystemClipboard.h */, + 84F1E92A1040369C006A1807 /* juce_UndoableAction.h */, + 84F1E9281040369C006A1807 /* juce_UndoManager.cpp */, + 84F1E9261040369C006A1807 /* juce_UndoManager.h */, ); name = utilities; path = ../../src/utilities; @@ -3211,6 +3215,7 @@ 844BB95F10C557A800DF5536 /* juce_Config.h in Headers */, 84B2053E10D535EC008B4A79 /* juce_ValueTree.h in Headers */, 84AB6F6E10EF948B00117E64 /* juce_HeapBlock.h in Headers */, + 84AF419B10F0008E0035D74F /* juce_ScopedPointer.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3536,6 +3541,7 @@ 84F29AA010C2EFA5005014DF /* juce_FillType.h in Headers */, 843D4A3C10D3C54500624BA6 /* juce_ValueTree.h in Headers */, 84DEDD9F10EE496500909D01 /* juce_HeapBlock.h in Headers */, + 84AF3FE810EF9FF30035D74F /* juce_ScopedPointer.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/extras/juce demo/build/linux/JuceDemo.make b/extras/juce demo/build/linux/JuceDemo.make index 5362e13646..d016ee3238 100644 --- a/extras/juce demo/build/linux/JuceDemo.make +++ b/extras/juce demo/build/linux/JuceDemo.make @@ -39,29 +39,29 @@ ifeq ($(CONFIG),Release) endif OBJECTS := \ - $(OBJDIR)/MainDemoWindow.o \ $(OBJDIR)/BinaryData.o \ - $(OBJDIR)/ApplicationStartup.o \ $(OBJDIR)/juce_LibrarySource.o \ + $(OBJDIR)/ApplicationStartup.o \ + $(OBJDIR)/MainDemoWindow.o \ $(OBJDIR)/AudioDemoLatencyPage.o \ $(OBJDIR)/AudioDemoPlaybackPage.o \ - $(OBJDIR)/AudioDemoRecordPage.o \ $(OBJDIR)/AudioDemoSetupPage.o \ $(OBJDIR)/AudioDemoSynthPage.o \ $(OBJDIR)/AudioDemoTabComponent.o \ $(OBJDIR)/CameraDemo.o \ $(OBJDIR)/DragAndDropDemo.o \ + $(OBJDIR)/FontsAndTextDemo.o \ $(OBJDIR)/InterprocessCommsDemo.o \ $(OBJDIR)/OpenGLDemo.o \ - $(OBJDIR)/RenderingTestComponent.o \ $(OBJDIR)/QuickTimeDemo.o \ $(OBJDIR)/TableDemo.o \ $(OBJDIR)/ThreadingDemo.o \ $(OBJDIR)/TreeViewDemo.o \ $(OBJDIR)/WebBrowserDemo.o \ $(OBJDIR)/CodeEditorDemo.o \ - $(OBJDIR)/FontsAndTextDemo.o \ + $(OBJDIR)/RenderingTestComponent.o \ $(OBJDIR)/WidgetsDemo.o \ + $(OBJDIR)/AudioDemoRecordPage.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) @@ -103,12 +103,12 @@ else -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif -$(OBJDIR)/MainDemoWindow.o: ../../src/MainDemoWindow.cpp +$(OBJDIR)/BinaryData.o: ../../src/BinaryData.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/BinaryData.o: ../../src/BinaryData.cpp +$(OBJDIR)/juce_LibrarySource.o: ../../src/juce_LibrarySource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -118,7 +118,7 @@ $(OBJDIR)/ApplicationStartup.o: ../../src/ApplicationStartup.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_LibrarySource.o: ../../src/juce_LibrarySource.cpp +$(OBJDIR)/MainDemoWindow.o: ../../src/MainDemoWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -133,11 +133,6 @@ $(OBJDIR)/AudioDemoPlaybackPage.o: ../../src/demos/AudioDemoPlaybackPage.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/AudioDemoRecordPage.o: ../../src/demos/AudioDemoRecordPage.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/AudioDemoSetupPage.o: ../../src/demos/AudioDemoSetupPage.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -163,17 +158,17 @@ $(OBJDIR)/DragAndDropDemo.o: ../../src/demos/DragAndDropDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/InterprocessCommsDemo.o: ../../src/demos/InterprocessCommsDemo.cpp +$(OBJDIR)/FontsAndTextDemo.o: ../../src/demos/FontsAndTextDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/OpenGLDemo.o: ../../src/demos/OpenGLDemo.cpp +$(OBJDIR)/InterprocessCommsDemo.o: ../../src/demos/InterprocessCommsDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/RenderingTestComponent.o: ../../src/demos/RenderingTestComponent.cpp +$(OBJDIR)/OpenGLDemo.o: ../../src/demos/OpenGLDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -208,7 +203,7 @@ $(OBJDIR)/CodeEditorDemo.o: ../../src/demos/CodeEditorDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/FontsAndTextDemo.o: ../../src/demos/FontsAndTextDemo.cpp +$(OBJDIR)/RenderingTestComponent.o: ../../src/demos/RenderingTestComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -218,5 +213,10 @@ $(OBJDIR)/WidgetsDemo.o: ../../src/demos/WidgetsDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/AudioDemoRecordPage.o: ../../src/demos/AudioDemoRecordPage.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + -include $(OBJECTS:%.o=%.d) diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index dc290e0b25..0d0cb81044 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -1087,7 +1087,6 @@ FileLogger::FileLogger (const File& logFile_, FileLogger::~FileLogger() { - deleteAndZero (logStream); } void FileLogger::logMessage (const String& message) @@ -1114,7 +1113,7 @@ void FileLogger::trimFileSize (int maxFileSizeBytes) const if (fileSize > maxFileSizeBytes) { - FileInputStream* const in = logFile.createInputStream(); + ScopedPointer in (logFile.createInputStream()); jassert (in != 0); if (in != 0) @@ -1128,7 +1127,7 @@ void FileLogger::trimFileSize (int maxFileSizeBytes) const contentToSave.fillWith (0); in->read (contentToSave.getData(), maxFileSizeBytes); - delete in; + in = 0; content = contentToSave.toString(); } @@ -1192,7 +1191,7 @@ void Logger::setCurrentLogger (Logger* const newLogger, Logger* const oldLogger = currentLogger; currentLogger = newLogger; - if (deleteOldLogger && (oldLogger != 0)) + if (deleteOldLogger) delete oldLogger; } @@ -4667,17 +4666,12 @@ MD5::MD5 (InputStream& input, int numBytesToRead) MD5::MD5 (const File& file) { - FileInputStream* const fin = file.createInputStream(); + const ScopedPointer fin (file.createInputStream()); if (fin != 0) - { processStream (*fin, -1); - delete fin; - } else - { zeromem (result, sizeof (result)); - } } MD5::~MD5() @@ -5851,8 +5845,7 @@ DirectoryIterator::DirectoryIterator (const File& directory, const int whatToLookFor_) throw() : wildCard (wc), index (-1), - whatToLookFor (whatToLookFor_), - subIterator (0) + whatToLookFor (whatToLookFor_) { // you have to specify the type of files you're looking for! jassert ((whatToLookFor_ & (File::findFiles | File::findDirectories)) != 0); @@ -5913,8 +5906,6 @@ DirectoryIterator::DirectoryIterator (const File& directory, DirectoryIterator::~DirectoryIterator() throw() { - if (subIterator != 0) - delete subIterator; } bool DirectoryIterator::next() throw() @@ -5924,7 +5915,7 @@ bool DirectoryIterator::next() throw() if (subIterator->next()) return true; - deleteAndZero (subIterator); + subIterator = 0; } if (index >= filesFound.size() + dirsFound.size() - 1) @@ -6845,17 +6836,12 @@ FileInputStream* File::createInputStream() const throw() FileOutputStream* File::createOutputStream (const int bufferSize) const throw() { - FileOutputStream* const out = new FileOutputStream (*this, bufferSize); + ScopedPointer out (new FileOutputStream (*this, bufferSize)); if (out->failedToOpen()) - { - delete out; return 0; - } - else - { - return out; - } + + return out.release(); } bool File::appendData (const void* const dataToAppend, @@ -6863,13 +6849,12 @@ bool File::appendData (const void* const dataToAppend, { if (numberOfBytes > 0) { - FileOutputStream* const out = createOutputStream(); + const ScopedPointer out (createOutputStream()); if (out == 0) return false; out->write (dataToAppend, numberOfBytes); - delete out; } return true; @@ -6899,13 +6884,11 @@ bool File::appendText (const String& text, const bool asUnicode, const bool writeUnicodeHeaderBytes) const throw() { - FileOutputStream* const out = createOutputStream(); + const ScopedPointer out (createOutputStream()); if (out != 0) { out->writeText (text, asUnicode, writeUnicodeHeaderBytes); - delete out; - return true; } @@ -8463,10 +8446,7 @@ InputStream* URL::createInputStream (const bool usePostCommand, timeOutMs); if (wi->isError()) - { - delete wi; - wi = 0; - } + deleteAndZero (wi); return wi; } @@ -8474,13 +8454,11 @@ InputStream* URL::createInputStream (const bool usePostCommand, bool URL::readEntireBinaryStream (MemoryBlock& destData, const bool usePostCommand) const { - InputStream* const in = createInputStream (usePostCommand); + const ScopedPointer in (createInputStream (usePostCommand)); if (in != 0) { in->readIntoMemoryBlock (destData, -1); - delete in; - return true; } @@ -8489,16 +8467,12 @@ bool URL::readEntireBinaryStream (MemoryBlock& destData, const String URL::readEntireTextStream (const bool usePostCommand) const { - String result; - InputStream* const in = createInputStream (usePostCommand); + const ScopedPointer in (createInputStream (usePostCommand)); if (in != 0) - { - result = in->readEntireStreamAsString(); - delete in; - } + return in->readEntireStreamAsString(); - return result; + return String::empty; } XmlElement* URL::readEntireXmlStream (const bool usePostCommand) const @@ -9374,7 +9348,6 @@ private: ZipFile::ZipFile (InputStream* const source_, const bool deleteStreamWhenDestroyed_) throw() : inputStream (source_), - inputSource (0), deleteStreamWhenDestroyed (deleteStreamWhenDestroyed_) #ifdef JUCE_DEBUG , numOpenStreams (0) @@ -9408,16 +9381,11 @@ ZipFile::ZipFile (InputSource* const inputSource_) ZipFile::~ZipFile() throw() { for (int i = entries.size(); --i >= 0;) - { - ZipEntryInfo* const zei = (ZipEntryInfo*) entries [i]; - delete zei; - } + delete (ZipEntryInfo*) entries.getUnchecked(i); if (deleteStreamWhenDestroyed) delete inputStream; - delete inputSource; - #ifdef JUCE_DEBUG // If you hit this assertion, it means you've created a stream to read // one of the items in the zipfile, but you've forgotten to delete that @@ -9496,13 +9464,13 @@ void ZipFile::sortEntriesByFilename() void ZipFile::init() { + ScopedPointer toDelete; InputStream* in = inputStream; - bool deleteInput = false; if (inputSource != 0) { - deleteInput = true; in = inputSource->createInputStream(); + toDelete = in; } if (in != 0) @@ -9561,9 +9529,6 @@ void ZipFile::init() } } } - - if (deleteInput) - delete in; } } @@ -9618,7 +9583,7 @@ void ZipFile::uncompressTo (const File& targetDirectory, } else { - InputStream* const in = createStreamForEntry (i); + ScopedPointer in (createStreamForEntry (i)); if (in != 0) { @@ -9628,20 +9593,18 @@ void ZipFile::uncompressTo (const File& targetDirectory, if ((! targetFile.exists()) && targetFile.getParentDirectory().createDirectory()) { - FileOutputStream* const out = targetFile.createOutputStream(); + ScopedPointer out (targetFile.createOutputStream()); if (out != 0) { out->writeFromInputStream (*in, -1); - delete out; + out = 0; targetFile.setCreationTime (zei.entry.fileTime); targetFile.setLastModificationTime (zei.entry.fileTime); targetFile.setLastAccessTime (zei.entry.fileTime); } } - - delete in; } } } @@ -13413,8 +13376,7 @@ static bool isXmlIdentifierChar_Slow (const tchar c) throw() XmlDocument::XmlDocument (const String& documentText) throw() : originalText (documentText), - ignoreEmptyTextElements (true), - inputSource (0) + ignoreEmptyTextElements (true) { } @@ -13425,16 +13387,11 @@ XmlDocument::XmlDocument (const File& file) XmlDocument::~XmlDocument() throw() { - delete inputSource; } void XmlDocument::setInputSource (InputSource* const newSource) throw() { - if (inputSource != newSource) - { - delete inputSource; - inputSource = newSource; - } + inputSource = newSource; } void XmlDocument::setEmptyTextElementsIgnored (const bool shouldBeIgnored) throw() @@ -13448,14 +13405,13 @@ XmlElement* XmlDocument::getDocumentElement (const bool onlyReadOuterDocumentEle if (textToParse.isEmpty() && inputSource != 0) { - InputStream* const in = inputSource->createInputStream(); + ScopedPointer in (inputSource->createInputStream()); if (in != 0) { MemoryBlock data; in->readIntoMemoryBlock (data, onlyReadOuterDocumentElement ? 8192 : -1); - delete in; if (data.getSize() >= 2 && ((data[0] == (char)-2 && data[1] == (char)-1) @@ -13492,12 +13448,10 @@ XmlElement* XmlDocument::getDocumentElement (const bool onlyReadOuterDocumentEle if (input != 0) { - XmlElement* const result = readNextElement (! onlyReadOuterDocumentElement); + ScopedPointer result (readNextElement (! onlyReadOuterDocumentElement)); - if (errorOccurred) - delete result; - else - return result; + if (! errorOccurred) + return result.release(); } else { @@ -13521,20 +13475,15 @@ void XmlDocument::setLastError (const String& desc, const bool carryOn) throw() const String XmlDocument::getFileContents (const String& filename) const { - String result; - if (inputSource != 0) { - InputStream* const in = inputSource->createInputStreamFor (filename.trim().unquoted()); + const ScopedPointer in (inputSource->createInputStreamFor (filename.trim().unquoted())); if (in != 0) - { - result = in->readEntireStreamAsString(); - delete in; - } + return in->readEntireStreamAsString(); } - return result; + return String::empty; } tchar XmlDocument::readNextChar() throw() @@ -14676,12 +14625,12 @@ bool XmlElement::writeToFile (const File& file, { const File tempFile (file.getNonexistentSibling()); - FileOutputStream* const out = tempFile.createOutputStream(); + ScopedPointer out (tempFile.createOutputStream()); if (out != 0) { writeToStream (*out, dtdToUse, false, true, encodingType, lineWrapLength); - delete out; + out = 0; if (! tempFile.exists()) return false; @@ -17364,7 +17313,7 @@ ApplicationCommandManager::ApplicationCommandManager() ApplicationCommandManager::~ApplicationCommandManager() { Desktop::getInstance().removeFocusChangeListener (this); - deleteAndZero (keyMappings); + keyMappings = 0; } void ApplicationCommandManager::clearCommands() @@ -17811,9 +17760,8 @@ ApplicationCommandTarget::CommandTargetMessageInvoker::~CommandTargetMessageInvo void ApplicationCommandTarget::CommandTargetMessageInvoker::handleMessage (const Message& message) { - InvocationInfo* const info = (InvocationInfo*) message.pointerParameter; + const ScopedPointer info ((InvocationInfo*) message.pointerParameter); owner->tryToInvoke (*info, false); - delete info; } END_JUCE_NAMESPACE @@ -17826,9 +17774,7 @@ BEGIN_JUCE_NAMESPACE juce_ImplementSingleton (ApplicationProperties) ApplicationProperties::ApplicationProperties() throw() - : userProps (0), - commonProps (0), - msBeforeSaving (3000), + : msBeforeSaving (3000), options (PropertiesFile::storeAsBinary), commonSettingsAreReadOnly (0) { @@ -17939,8 +17885,8 @@ bool ApplicationProperties::saveIfNeeded() void ApplicationProperties::closeFiles() { - deleteAndZero (userProps); - deleteAndZero (commonProps); + userProps = 0; + commonProps = 0; } END_JUCE_NAMESPACE @@ -18024,7 +17970,7 @@ PropertiesFile::PropertiesFile (const File& f, || (options_ & (storeAsBinary | storeAsCompressedBinary | storeAsXML)) == storeAsCompressedBinary || (options_ & (storeAsBinary | storeAsCompressedBinary | storeAsXML)) == storeAsXML); - InputStream* fileStream = f.createInputStream(); + ScopedPointer fileStream (f.createInputStream()); if (fileStream != 0) { @@ -18032,15 +17978,15 @@ PropertiesFile::PropertiesFile (const File& f, if (magicNumber == propFileMagicNumberCompressed) { - fileStream = new SubregionStream (fileStream, 4, -1, true); - fileStream = new GZIPDecompressorInputStream (fileStream, true); + fileStream = new GZIPDecompressorInputStream (new SubregionStream (fileStream.release(), 4, -1, true), + true); magicNumber = propFileMagicNumber; } if (magicNumber == propFileMagicNumber) { - BufferedInputStream in (fileStream, 2048, true); + BufferedInputStream in (fileStream.release(), 2048, true); int numValues = in.readInt(); @@ -18057,14 +18003,13 @@ PropertiesFile::PropertiesFile (const File& f, else { // Not a binary props file - let's see if it's XML.. - delete fileStream; + fileStream = 0; XmlDocument parser (f); - XmlElement* doc = parser.getDocumentElement (true); + ScopedPointer doc (parser.getDocumentElement (true)); if (doc != 0 && doc->hasTagName (propertyFileXmlTag)) { - delete doc; doc = parser.getDocumentElement(); if (doc != 0) @@ -18087,8 +18032,6 @@ PropertiesFile::PropertiesFile (const File& f, // must be a pretty broken XML file we're trying to parse here! jassertfalse } - - delete doc; } } } @@ -18126,7 +18069,7 @@ bool PropertiesFile::save() if ((options & storeAsXML) != 0) { - XmlElement* const doc = new XmlElement (propertyFileXmlTag); + XmlElement doc (propertyFileXmlTag); for (int i = 0; i < getAllProperties().size(); ++i) { @@ -18142,19 +18085,15 @@ bool PropertiesFile::save() else e->setAttribute (T("val"), getAllProperties().getAllValues() [i]); - doc->addChildElement (e); + doc.addChildElement (e); } - const bool ok = doc->writeToFile (file, String::empty); - - delete doc; - - return ok; + return doc.writeToFile (file, String::empty); } else { const File tempFile (file.getNonexistentSibling (false)); - OutputStream* out = tempFile.createOutputStream(); + ScopedPointer out (tempFile.createOutputStream()); if (out != 0) { @@ -18163,7 +18102,7 @@ bool PropertiesFile::save() out->writeInt (propFileMagicNumberCompressed); out->flush(); - out = new GZIPCompressorOutputStream (out, 9, true); + out = new GZIPCompressorOutputStream (out.release(), 9, true); } else { @@ -18184,7 +18123,7 @@ bool PropertiesFile::save() } out->flush(); - delete out; + out = 0; if (tempFile.moveFileTo (file)) { @@ -19747,8 +19686,6 @@ AudioCDReader::AudioCDReader (const File& volume) AudioCDReader::~AudioCDReader() { - if (reader != 0) - delete reader; } static int getTrackNumber (const File& file) @@ -19787,13 +19724,10 @@ void AudioCDReader::refreshTrackLengths() if (in != 0) { - AudioFormatReader* const r = format.createReaderFor (in, true); + ScopedPointer r (format.createReaderFor (in, true)); if (r != 0) - { sample += (int) r->lengthInSamples; - delete r; - } } } @@ -19822,7 +19756,7 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta if (track != currentReaderTrack) { - deleteAndZero (reader); + reader = 0; if (tracks [track] != 0) { @@ -20730,8 +20664,6 @@ AudioThumbnail::AudioThumbnail (const int orginalSamplesPerThumbnailSample_, AudioThumbnailCache& cacheToUse) : formatManagerToUse (formatManagerToUse_), cache (cacheToUse), - source (0), - reader (0), orginalSamplesPerThumbnailSample (orginalSamplesPerThumbnailSample_) { clear(); @@ -20742,9 +20674,7 @@ AudioThumbnail::~AudioThumbnail() cache.removeThumbnail (this); const ScopedLock sl (readerLock); - deleteAndZero (reader); - - delete source; + reader = 0; } void AudioThumbnail::setSource (InputSource* const newSource) @@ -20752,9 +20682,7 @@ void AudioThumbnail::setSource (InputSource* const newSource) cache.removeThumbnail (this); timerCallback(); // stops the timer and deletes the reader - delete source; source = newSource; - clear(); if (newSource != 0 @@ -20828,7 +20756,7 @@ void AudioThumbnail::timerCallback() stopTimer(); const ScopedLock sl (readerLock); - deleteAndZero (reader); + reader = 0; } void AudioThumbnail::clear() @@ -22422,30 +22350,26 @@ static bool juce_slowCopyOfWavFileWithNewMetadata (const File& file, const Strin const File dest (file.getNonexistentSibling()); - OutputStream* outStream = dest.createOutputStream(); - - if (outStream != 0) { - AudioFormatReader* reader = wav.createReaderFor (file.createInputStream(), true); + ScopedPointer outStream (dest.createOutputStream()); - if (reader != 0) + if (outStream != 0) { - AudioFormatWriter* writer = wav.createWriterFor (outStream, reader->sampleRate, - reader->numChannels, reader->bitsPerSample, - metadata, 0); + ScopedPointer reader (wav.createReaderFor (file.createInputStream(), true)); - if (writer != 0) + if (reader != 0) { - ok = writer->writeFromAudioReader (*reader, 0, -1); + ScopedPointer writer (wav.createWriterFor (outStream, reader->sampleRate, + reader->numChannels, reader->bitsPerSample, + metadata, 0)); - outStream = 0; - delete writer; + if (writer != 0) + { + ok = writer->writeFromAudioReader (*reader, 0, -1); + outStream.release(); + } } - - delete reader; } - - delete outStream; } if (ok) @@ -22459,13 +22383,13 @@ static bool juce_slowCopyOfWavFileWithNewMetadata (const File& file, const Strin bool WavAudioFormat::replaceMetadataInFile (const File& wavFile, const StringPairArray& newMetadata) { - WavAudioFormatReader* reader = (WavAudioFormatReader*) createReaderFor (wavFile.createInputStream(), true); + ScopedPointer reader ((WavAudioFormatReader*) createReaderFor (wavFile.createInputStream(), true)); if (reader != 0) { const int64 bwavPos = reader->bwavChunkStart; const int64 bwavSize = reader->bwavSize; - delete reader; + reader = 0; if (bwavSize > 0) { @@ -22476,11 +22400,12 @@ bool WavAudioFormat::replaceMetadataInFile (const File& wavFile, const StringPai // the new one will fit in the space available, so write it directly.. const int64 oldSize = wavFile.getSize(); - FileOutputStream* out = wavFile.createOutputStream(); - out->setPosition (bwavPos); - out->write (chunk.getData(), chunk.getSize()); - out->setPosition (oldSize); - delete out; + { + ScopedPointer out (wavFile.createOutputStream()); + out->setPosition (bwavPos); + out->write (chunk.getData(), chunk.getSize()); + out->setPosition (oldSize); + } jassert (wavFile.getSize() == oldSize); @@ -22816,8 +22741,8 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, PositionableAudioSource* newPositionableSource = 0; AudioSource* newMasterSource = 0; - ResamplingAudioSource* oldResamplerSource = resamplerSource; - BufferingAudioSource* oldBufferingSource = bufferingSource; + ScopedPointer oldResamplerSource (resamplerSource); + ScopedPointer oldBufferingSource (bufferingSource); AudioSource* oldMasterSource = masterSource; if (newSource != 0) @@ -22859,9 +22784,6 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, if (oldMasterSource != 0) oldMasterSource->releaseResources(); - - delete oldResamplerSource; - delete oldBufferingSource; } void AudioTransportSource::start() @@ -24056,12 +23978,10 @@ AudioDeviceManager::AudioDeviceManager() : currentAudioDevice (0), numInputChansNeeded (0), numOutputChansNeeded (2), - lastExplicitSettings (0), listNeedsScanning (true), useInputNames (false), inputLevelMeasurementEnabledCount (0), inputLevel (0), - testSound (0), tempBuffer (2, 2), enabledMidiInputs (4), midiCallbacks (4), @@ -24075,10 +23995,8 @@ AudioDeviceManager::AudioDeviceManager() AudioDeviceManager::~AudioDeviceManager() { - deleteAndZero (currentAudioDevice); - deleteAndZero (defaultMidiOutput); - delete lastExplicitSettings; - delete testSound; + currentAudioDevice = 0; + defaultMidiOutput = 0; } void AudioDeviceManager::createDeviceTypesIfNeeded() @@ -24157,7 +24075,6 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, if (e != 0 && e->hasTagName (T("DEVICESETUP"))) { - delete lastExplicitSettings; lastExplicitSettings = new XmlElement (*e); String error; @@ -24316,7 +24233,7 @@ void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup) void AudioDeviceManager::deleteCurrentDevice() { - deleteAndZero (currentAudioDevice); + currentAudioDevice = 0; currentSetup.inputDeviceName = String::empty; currentSetup.outputDeviceName = String::empty; } @@ -24518,13 +24435,13 @@ void AudioDeviceManager::stopDevice() if (currentAudioDevice != 0) currentAudioDevice->stop(); - deleteAndZero (testSound); + testSound = 0; } void AudioDeviceManager::closeAudioDevice() { stopDevice(); - deleteAndZero (currentAudioDevice); + currentAudioDevice = 0; } void AudioDeviceManager::restartLastAudioDevice() @@ -24548,7 +24465,6 @@ void AudioDeviceManager::restartLastAudioDevice() void AudioDeviceManager::updateXml() { - delete lastExplicitSettings; lastExplicitSettings = new XmlElement (T("DEVICESETUP")); lastExplicitSettings->setAttribute (T("deviceType"), currentDeviceType); @@ -24710,10 +24626,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat testSoundPosition += numSamps; if (testSoundPosition >= testSound->getNumSamples()) - { - delete testSound; testSound = 0; - } } } @@ -24876,7 +24789,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName) for (int i = oldCallbacks.size(); --i >= 0;) oldCallbacks.getUnchecked(i)->audioDeviceStopped(); - deleteAndZero (defaultMidiOutput); + defaultMidiOutput = 0; defaultMidiOutputName = deviceName; if (deviceName.isNotEmpty()) @@ -24923,8 +24836,7 @@ void AudioDeviceManager::CallbackHandler::handleIncomingMidiMessage (MidiInput* void AudioDeviceManager::playTestSound() { audioCallbackLock.enter(); - AudioSampleBuffer* oldSound = testSound; - testSound = 0; + AudioSampleBuffer* oldSound = testSound.release(); audioCallbackLock.exit(); delete oldSound; @@ -26849,8 +26761,7 @@ struct TimeSigInfo }; MidiFile::MidiFile() throw() - : numTracks (0), - timeFormat ((short)(unsigned short)0xe728) + : timeFormat ((short) (unsigned short) 0xe728) { } @@ -26861,26 +26772,22 @@ MidiFile::~MidiFile() throw() void MidiFile::clear() throw() { - while (numTracks > 0) - delete tracks [--numTracks]; + tracks.clear(); } int MidiFile::getNumTracks() const throw() { - return numTracks; + return tracks.size(); } const MidiMessageSequence* MidiFile::getTrack (const int index) const throw() { - return (((unsigned int) index) < (unsigned int) numTracks) ? tracks[index] : 0; + return tracks [index]; } void MidiFile::addTrack (const MidiMessageSequence& trackSequence) throw() { - jassert (numTracks < numElementsInArray (tracks)); - - if (numTracks < numElementsInArray (tracks)) - tracks [numTracks++] = new MidiMessageSequence (trackSequence); + tracks.add (new MidiMessageSequence (trackSequence)); } short MidiFile::getTimeFormat() const throw() @@ -26901,13 +26808,13 @@ void MidiFile::setSmpteTimeFormat (const int framesPerSecond, void MidiFile::findAllTempoEvents (MidiMessageSequence& tempoChangeEvents) const { - for (int i = numTracks; --i >= 0;) + for (int i = tracks.size(); --i >= 0;) { - const int numEvents = tracks[i]->getNumEvents(); + const int numEvents = tracks.getUnchecked(i)->getNumEvents(); for (int j = 0; j < numEvents; ++j) { - const MidiMessage& m = tracks[i]->getEventPointer (j)->message; + const MidiMessage& m = tracks.getUnchecked(i)->getEventPointer (j)->message; if (m.isTempoMetaEvent()) tempoChangeEvents.addEvent (m); @@ -26917,13 +26824,13 @@ void MidiFile::findAllTempoEvents (MidiMessageSequence& tempoChangeEvents) const void MidiFile::findAllTimeSigEvents (MidiMessageSequence& timeSigEvents) const { - for (int i = numTracks; --i >= 0;) + for (int i = tracks.size(); --i >= 0;) { - const int numEvents = tracks[i]->getNumEvents(); + const int numEvents = tracks.getUnchecked(i)->getNumEvents(); for (int j = 0; j < numEvents; ++j) { - const MidiMessage& m = tracks[i]->getEventPointer (j)->message; + const MidiMessage& m = tracks.getUnchecked(i)->getEventPointer (j)->message; if (m.isTimeSignatureMetaEvent()) timeSigEvents.addEvent (m); @@ -26935,8 +26842,8 @@ double MidiFile::getLastTimestamp() const { double t = 0.0; - for (int i = numTracks; --i >= 0;) - t = jmax (t, tracks[i]->getEndTime()); + for (int i = tracks.size(); --i >= 0;) + t = jmax (t, tracks.getUnchecked(i)->getEndTime()); return t; } @@ -27166,9 +27073,9 @@ void MidiFile::convertTimestampTicksToSeconds() findAllTempoEvents (tempoEvents); findAllTimeSigEvents (tempoEvents); - for (int i = 0; i < numTracks; ++i) + for (int i = 0; i < tracks.size(); ++i) { - MidiMessageSequence& ms = *tracks[i]; + MidiMessageSequence& ms = *tracks.getUnchecked(i); for (int j = ms.getNumEvents(); --j >= 0;) { @@ -27207,10 +27114,10 @@ bool MidiFile::writeTo (OutputStream& out) out.writeIntBigEndian ((int) bigEndianInt ("MThd")); out.writeIntBigEndian (6); out.writeShortBigEndian (1); // type - out.writeShortBigEndian (numTracks); + out.writeShortBigEndian (tracks.size()); out.writeShortBigEndian (timeFormat); - for (int i = 0; i < numTracks; ++i) + for (int i = 0; i < tracks.size(); ++i) writeTrack (out, i); out.flush(); @@ -32755,7 +32662,7 @@ public: ~VSTPluginWindow() { #if JUCE_MAC - deleteAndZero (innerWrapper); + innerWrapper = 0; #else closePluginWindow(); #endif @@ -33441,7 +33348,7 @@ private: }; friend class InnerWrapperComponent; - InnerWrapperComponent* innerWrapper; + ScopedPointer innerWrapper; void resized() { @@ -34361,7 +34268,7 @@ void VSTPluginFormat::findAllTypesForFile (OwnedArray & resul desc.fileOrIdentifier = fileOrIdentifier; desc.uid = 0; - VSTPluginInstance* instance = dynamic_cast (createInstanceFromDescription (desc)); + ScopedPointer instance (dynamic_cast (createInstanceFromDescription (desc))); if (instance == 0) return; @@ -34428,13 +34335,11 @@ void VSTPluginFormat::findAllTypesForFile (OwnedArray & resul { // crashed while loading... } - - deleteAndZero (instance); } AudioPluginInstance* VSTPluginFormat::createInstanceFromDescription (const PluginDescription& desc) { - VSTPluginInstance* result = 0; + ScopedPointer result; if (fileMightContainThisPluginType (desc.fileOrIdentifier)) { @@ -34458,14 +34363,14 @@ AudioPluginInstance* VSTPluginFormat::createInstanceFromDescription (const Plugi } else { - deleteAndZero (result); + result = 0; } } previousWorkingDirectory.setAsCurrentWorkingDirectory(); } - return result; + return result.release(); } bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdentifier) @@ -36460,7 +36365,6 @@ SamplerSound::SamplerSound (const String& name_, if (sourceSampleRate <= 0 || source.lengthInSamples <= 0) { - data = 0; length = 0; attackSamples = 0; releaseSamples = 0; @@ -36481,8 +36385,6 @@ SamplerSound::SamplerSound (const String& name_, SamplerSound::~SamplerSound() { - delete data; - data = 0; } bool SamplerSound::appliesToNote (const int midiNoteNumber) @@ -37301,8 +37203,6 @@ BEGIN_JUCE_NAMESPACE InterprocessConnection::InterprocessConnection (const bool callbacksOnMessageThread, const uint32 magicMessageHeaderNumber) : Thread ("Juce IPC connection"), - socket (0), - pipe (0), callbackConnectionState (false), useMessageThread (callbacksOnMessageThread), magicMessageHeader (magicMessageHeaderNumber), @@ -37333,7 +37233,7 @@ bool InterprocessConnection::connectToSocket (const String& hostName, } else { - deleteAndZero (socket); + socket = 0; return false; } } @@ -37343,20 +37243,17 @@ bool InterprocessConnection::connectToPipe (const String& pipeName, { disconnect(); - NamedPipe* const newPipe = new NamedPipe(); + ScopedPointer newPipe (new NamedPipe()); if (newPipe->openExisting (pipeName)) { const ScopedLock sl (pipeAndSocketLock); pipeReceiveMessageTimeout = pipeReceiveMessageTimeoutMs; - initialiseWithPipe (newPipe); + initialiseWithPipe (newPipe.release()); return true; } - else - { - delete newPipe; - return false; - } + + return false; } bool InterprocessConnection::createPipe (const String& pipeName, @@ -37364,20 +37261,17 @@ bool InterprocessConnection::createPipe (const String& pipeName, { disconnect(); - NamedPipe* const newPipe = new NamedPipe(); + ScopedPointer newPipe (new NamedPipe()); if (newPipe->createNewPipe (pipeName)) { const ScopedLock sl (pipeAndSocketLock); pipeReceiveMessageTimeout = pipeReceiveMessageTimeoutMs; - initialiseWithPipe (newPipe); + initialiseWithPipe (newPipe.release()); return true; } - else - { - delete newPipe; - return false; - } + + return false; } void InterprocessConnection::disconnect() @@ -37395,8 +37289,8 @@ void InterprocessConnection::disconnect() { const ScopedLock sl (pipeAndSocketLock); - deleteAndZero (socket); - deleteAndZero (pipe); + socket = 0; + pipe = 0; } connectionLostInt(); @@ -37485,12 +37379,11 @@ void InterprocessConnection::handleMessage (const Message& message) switch (message.intParameter2) { case 0: - { - MemoryBlock* const data = (MemoryBlock*) message.pointerParameter; - messageReceived (*data); - delete data; - break; - } + { + ScopedPointer data ((MemoryBlock*) message.pointerParameter); + messageReceived (*data); + break; + } case 1: connectionMade(); @@ -37581,7 +37474,7 @@ bool InterprocessConnection::readNextMessageInt() { { const ScopedLock sl (pipeAndSocketLock); - deleteAndZero (socket); + socket = 0; } connectionLostInt(); @@ -37603,7 +37496,7 @@ void InterprocessConnection::run() { { const ScopedLock sl (pipeAndSocketLock); - deleteAndZero (socket); + socket = 0; } connectionLostInt(); @@ -37625,7 +37518,7 @@ void InterprocessConnection::run() { { const ScopedLock sl (pipeAndSocketLock); - deleteAndZero (pipe); + pipe = 0; } connectionLostInt(); @@ -37652,8 +37545,7 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE InterprocessConnectionServer::InterprocessConnectionServer() - : Thread ("Juce IPC server"), - socket (0) + : Thread ("Juce IPC server") { } @@ -37674,7 +37566,7 @@ bool InterprocessConnectionServer::beginWaitingForSocket (const int portNumber) return true; } - deleteAndZero (socket); + socket = 0; return false; } @@ -37686,28 +37578,21 @@ void InterprocessConnectionServer::stop() socket->close(); stopThread (4000); - - deleteAndZero (socket); + socket = 0; } void InterprocessConnectionServer::run() { while ((! threadShouldExit()) && socket != 0) { - StreamingSocket* const clientSocket = socket->waitForNextConnection(); + ScopedPointer clientSocket (socket->waitForNextConnection()); if (clientSocket != 0) { InterprocessConnection* newConnection = createConnectionObject(); if (newConnection != 0) - { - newConnection->initialiseWithSocket (clientSocket); - } - else - { - delete clientSocket; - } + newConnection->initialiseWithSocket (clientSocket.release()); } } } @@ -37792,8 +37677,7 @@ MessageManager* MessageManager::instance = 0; static const int quitMessageId = 0xfffff321; MessageManager::MessageManager() throw() - : broadcastListeners (0), - quitMessagePosted (false), + : quitMessagePosted (false), quitMessageReceived (false), threadWithLock (0) { @@ -37802,7 +37686,7 @@ MessageManager::MessageManager() throw() MessageManager::~MessageManager() throw() { - deleteAndZero (broadcastListeners); + broadcastListeners = 0; doPlatformSpecificShutdown(); @@ -37845,7 +37729,7 @@ void MessageManager::postCallbackMessage (Message* const message) // not for public use.. void MessageManager::deliverMessage (void* message) { - Message* const m = (Message*) message; + const ScopedPointer m ((Message*) message); MessageListener* const recipient = m->messageRecipient; JUCE_TRY @@ -37862,7 +37746,7 @@ void MessageManager::deliverMessage (void* message) } else { - CallbackMessage* const cm = dynamic_cast (m); + CallbackMessage* const cm = dynamic_cast ((Message*) m); if (cm != 0) cm->messageCallback(); @@ -37870,8 +37754,6 @@ void MessageManager::deliverMessage (void* message) } } JUCE_CATCH_EXCEPTION - - delete m; } #if ! (JUCE_MAC || JUCE_IPHONE) @@ -39890,7 +39772,7 @@ int Component::runModalLoop() Component* const prevFocused = getCurrentlyFocusedComponent(); - ComponentDeletionWatcher* deletionChecker = 0; + ScopedPointer deletionChecker; if (prevFocused != 0) deletionChecker = new ComponentDeletionWatcher (prevFocused); @@ -39933,13 +39815,8 @@ int Component::runModalLoop() modalComponentStack.removeValue (this); - if (deletionChecker != 0) - { - if (! deletionChecker->hasBeenDeleted()) - prevFocused->grabKeyboardFocus(); - - delete deletionChecker; - } + if (deletionChecker != 0 && ! deletionChecker->hasBeenDeleted()) + prevFocused->grabKeyboardFocus(); return returnValue; } @@ -41794,12 +41671,12 @@ void Component::grabFocusInternal (const FocusChangeType cause, const bool canTr else { // find the default child component.. - KeyboardFocusTraverser* const traverser = createFocusTraverser(); + ScopedPointer traverser (createFocusTraverser()); if (traverser != 0) { Component* const defaultComp = traverser->getDefaultComponent (this); - delete traverser; + traverser = 0; if (defaultComp != 0) { @@ -41836,13 +41713,13 @@ void Component::moveKeyboardFocusToSibling (const bool moveToNext) if (parentComponent_ != 0) { - KeyboardFocusTraverser* const traverser = createFocusTraverser(); + ScopedPointer traverser (createFocusTraverser()); if (traverser != 0) { Component* const nextComp = moveToNext ? traverser->getNextComponent (this) : traverser->getPreviousComponent (this); - delete traverser; + traverser = 0; if (nextComp != 0) { @@ -42549,7 +42426,6 @@ Button::Button (const String& name) keySource (0), text (name), buttonListeners (2), - repeatTimer (0), buttonPressTime (0), lastTimeCallbackTime (0), commandManagerToUse (0), @@ -42576,7 +42452,7 @@ Button::~Button() if (commandManagerToUse != 0) commandManagerToUse->removeListener (this); - delete repeatTimer; + repeatTimer = 0; clearShortcuts(); } @@ -43232,14 +43108,6 @@ DrawableButton::DrawableButton (const String& name, const DrawableButton::ButtonStyle buttonStyle) : Button (name), style (buttonStyle), - normalImage (0), - overImage (0), - downImage (0), - disabledImage (0), - normalImageOn (0), - overImageOn (0), - downImageOn (0), - disabledImageOn (0), edgeIndent (3) { if (buttonStyle == ImageOnButtonBackground) @@ -43261,14 +43129,6 @@ DrawableButton::~DrawableButton() void DrawableButton::deleteImages() { - deleteAndZero (normalImage); - deleteAndZero (overImage); - deleteAndZero (downImage); - deleteAndZero (disabledImage); - deleteAndZero (normalImageOn); - deleteAndZero (overImageOn); - deleteAndZero (downImageOn); - deleteAndZero (disabledImageOn); } void DrawableButton::setImages (const Drawable* normal, @@ -43611,29 +43471,9 @@ ImageButton::~ImageButton() void ImageButton::deleteImages() { - if (normalImage != 0) - { - if (ImageCache::isImageInCache (normalImage)) - ImageCache::release (normalImage); - else - delete normalImage; - } - - if (overImage != 0) - { - if (ImageCache::isImageInCache (overImage)) - ImageCache::release (overImage); - else - delete overImage; - } - - if (downImage != 0) - { - if (ImageCache::isImageInCache (downImage)) - ImageCache::release (downImage); - else - delete downImage; - } + ImageCache::releaseOrDelete (normalImage); + ImageCache::releaseOrDelete (overImage); + ImageCache::releaseOrDelete (downImage); } void ImageButton::setImages (const bool resizeButtonNowToFitThisImage, @@ -44001,8 +43841,6 @@ ToolbarButton::ToolbarButton (const int itemId_, ToolbarButton::~ToolbarButton() { - delete normalImage; - delete toggledOnImage; } bool ToolbarButton::getToolbarItemSizes (int toolbarDepth, @@ -47226,10 +47064,8 @@ Label::Label (const String& componentName, text (labelText), font (15.0f), justification (Justification::centredLeft), - editor (0), listeners (2), ownerComponent (0), - deletionWatcher (0), horizontalBorderSize (3), verticalBorderSize (1), minimumHorizontalScale (0.7f), @@ -47247,10 +47083,7 @@ Label::~Label() if (ownerComponent != 0 && ! deletionWatcher->hasBeenDeleted()) ownerComponent->removeComponentListener (this); - deleteAndZero (deletionWatcher); - - if (editor != 0) - delete editor; + editor = 0; } void Label::setText (const String& newText, @@ -47322,7 +47155,7 @@ void Label::attachToComponent (Component* owner, if (ownerComponent != 0 && ! deletionWatcher->hasBeenDeleted()) ownerComponent->removeComponentListener (this); - deleteAndZero (deletionWatcher); + deletionWatcher = 0; ownerComponent = owner; leftOfOwnerComp = onLeft; @@ -47436,7 +47269,7 @@ void Label::hideEditor (const bool discardCurrentEditorContents) const bool changed = (! discardCurrentEditorContents) && updateFromTextEditorContents(); - deleteAndZero (editor); + editor = 0; repaint(); if (changed) @@ -48471,9 +48304,7 @@ void ListBox::setHeaderComponent (Component* const newHeaderComponent) { if (headerComponent != newHeaderComponent) { - if (headerComponent != 0) - delete headerComponent; - + delete headerComponent; headerComponent = newHeaderComponent; addAndMakeVisible (newHeaderComponent); @@ -48807,7 +48638,7 @@ Slider::Slider (const String& name) Slider::~Slider() { - deleteAndZero (popupDisplay); + popupDisplay = 0; deleteAllChildren(); } @@ -49755,7 +49586,7 @@ void Slider::mouseUp (const MouseEvent&) sendDragEnd(); - deleteAndZero (popupDisplay); + popupDisplay = 0; if (style == IncDecButtons) { @@ -50085,7 +49916,6 @@ public: ~DragOverlayComp() { - delete image; } void paint (Graphics& g) @@ -50094,7 +49924,7 @@ public: } private: - Image* image; + ScopedPointer image; DragOverlayComp (const DragOverlayComp&); const DragOverlayComp& operator= (const DragOverlayComp&); @@ -50102,7 +49932,6 @@ private: TableHeaderComponent::TableHeaderComponent() : listeners (2), - dragOverlayComp (0), columnsChanged (false), columnsResized (false), sortChanged (false), @@ -50117,7 +49946,7 @@ TableHeaderComponent::TableHeaderComponent() TableHeaderComponent::~TableHeaderComponent() { - delete dragOverlayComp; + dragOverlayComp = 0; } void TableHeaderComponent::setPopupMenuActive (const bool hasMenu) @@ -50495,7 +50324,7 @@ const String TableHeaderComponent::toString() const void TableHeaderComponent::restoreFromString (const String& storedVersion) { XmlDocument doc (storedVersion); - XmlElement* const storedXml = doc.getDocumentElement(); + ScopedPointer storedXml (doc.getDocumentElement()); int index = 0; @@ -50523,8 +50352,6 @@ void TableHeaderComponent::restoreFromString (const String& storedVersion) setSortColumnId (storedXml->getIntAttribute (T("sortedCol")), storedXml->getBoolAttribute (T("sortForwards"), true)); } - - delete storedXml; } void TableHeaderComponent::addListener (TableHeaderListener* const newListener) throw() @@ -50647,7 +50474,7 @@ void TableHeaderComponent::mouseDrag (const MouseEvent& e) && columnIdBeingDragged == 0 && ! (e.mouseWasClicked() || e.mods.isPopupMenu())) { - deleteAndZero (dragOverlayComp); + dragOverlayComp = 0; columnIdBeingResized = getResizeDraggerAt (e.getMouseDownX()); @@ -50827,7 +50654,7 @@ void TableHeaderComponent::mouseUp (const MouseEvent& e) if (columnIdUnderMouse != 0 && e.mouseWasClicked() && ! e.mods.isPopupMenu()) columnClicked (columnIdUnderMouse, e.mods); - deleteAndZero (dragOverlayComp); + dragOverlayComp = 0; } const MouseCursor TableHeaderComponent::getMouseCursor() @@ -51582,10 +51409,7 @@ public: void clear() throw() { for (int i = atoms.size(); --i >= 0;) - { - TextAtom* const atom = getAtom(i); - delete atom; - } + delete getAtom(i); atoms.clear(); } @@ -55062,7 +54886,6 @@ ToolbarItemComponent::ToolbarItemComponent (const int itemId_, itemId (itemId_), mode (normalMode), toolbarStyle (Toolbar::iconsOnly), - overlayComp (0), dragOffsetX (0), dragOffsetY (0), isActive (true), @@ -55076,7 +54899,7 @@ ToolbarItemComponent::ToolbarItemComponent (const int itemId_, ToolbarItemComponent::~ToolbarItemComponent() { jassert (overlayComp == 0 || overlayComp->isValidComponent()); - delete overlayComp; + overlayComp = 0; } Toolbar* ToolbarItemComponent::getToolbar() const @@ -55164,7 +54987,6 @@ void ToolbarItemComponent::setEditingMode (const ToolbarEditingMode newMode) if (mode == normalMode) { jassert (overlayComp == 0 || overlayComp->isValidComponent()); - delete overlayComp; overlayComp = 0; } else if (overlayComp == 0) @@ -55704,9 +55526,8 @@ void TreeView::setRootItem (TreeViewItem* const newRootItem) void TreeView::deleteRootItem() { - TreeViewItem* const oldItem = rootItem; + const ScopedPointer deleter (rootItem); setRootItem (0); - delete oldItem; } void TreeView::setRootItemVisible (const bool shouldBeVisible) @@ -57352,7 +57173,7 @@ bool DirectoryContentsList::addFile (const String& filename, || ((! isDir) && fileFilter->isFileSuitable (file)) || (isDir && fileFilter->isDirectorySuitable (file)))) { - FileInfo* const info = new FileInfo(); + ScopedPointer info (new FileInfo()); info->filename = filename; info->fileSize = fileSize; @@ -57364,15 +57185,10 @@ bool DirectoryContentsList::addFile (const String& filename, const ScopedLock sl (fileListLock); for (int i = files.size(); --i >= 0;) - { if (files.getUnchecked(i)->filename == info->filename) - { - delete info; return false; - } - } - files.addSorted (*this, info); + files.addSorted (*this, info.release()); return true; } @@ -57495,7 +57311,7 @@ FileBrowserComponent::~FileBrowserComponent() removeChildComponent (previewComp); deleteAllChildren(); - deleteAndZero (fileList); + fileList = 0; thread.stopThread (10000); } @@ -57984,7 +57800,7 @@ bool FileChooser::showDialog (const bool selectsDirectories, const bool selectMultipleFiles, FilePreviewComponent* const previewComponent) { - ComponentDeletionWatcher* currentlyFocusedChecker = 0; + ScopedPointer currentlyFocusedChecker; Component* const currentlyFocused = Component::getCurrentlyFocusedComponent(); if (currentlyFocused != 0) @@ -58045,8 +57861,6 @@ bool FileChooser::showDialog (const bool selectsDirectories, if (currentlyFocused != 0 && ! currentlyFocusedChecker->hasBeenDeleted()) currentlyFocused->grabKeyboardFocus(); - delete currentlyFocusedChecker; - return results.size() > 0; } @@ -58440,7 +58254,7 @@ Component* FileListComponent::refreshComponentForRow (int row, bool isSelected, if (comp == 0) { delete existingComponentToUpdate; - existingComponentToUpdate = comp = new FileListItemComponent (*this, fileList.getTimeSliceThread()); + comp = new FileListItemComponent (*this, fileList.getTimeSliceThread()); } DirectoryContentsList::FileInfo fileInfo; @@ -59145,9 +58959,7 @@ FileTreeComponent::FileTreeComponent (DirectoryContentsList& listToShow) FileTreeComponent::~FileTreeComponent() { - TreeViewItem* const root = getRootItem(); - setRootItem (0); - delete root; + deleteRootItem(); } const File FileTreeComponent::getSelectedFile (const int index) const @@ -59178,13 +58990,11 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE ImagePreviewComponent::ImagePreviewComponent() - : currentThumbnail (0) { } ImagePreviewComponent::~ImagePreviewComponent() { - delete currentThumbnail; } void ImagePreviewComponent::getThumbSize (int& w, int& h) const @@ -59213,11 +59023,11 @@ void ImagePreviewComponent::timerCallback() { stopTimer(); - deleteAndZero (currentThumbnail); + currentThumbnail = 0; currentDetails = String::empty; repaint(); - FileInputStream* const in = fileToLoad.createInputStream(); + ScopedPointer in (fileToLoad.createInputStream()); if (in != 0) { @@ -59240,14 +59050,9 @@ void ImagePreviewComponent::timerCallback() getThumbSize (w, h); - Image* const reduced = currentThumbnail->createCopy (w, h); - - delete currentThumbnail; - currentThumbnail = reduced; + currentThumbnail = currentThumbnail->createCopy (w, h); } } - - delete in; } } @@ -59805,7 +59610,7 @@ void KeyMappingEditorComponent::buttonClicked (Button* button) void KeyMappingEditorComponent::changeListenerCallback (void*) { - XmlElement* openness = tree->getOpennessState (true); + ScopedPointer openness (tree->getOpennessState (true)); clearSubItems(); @@ -59825,10 +59630,7 @@ void KeyMappingEditorComponent::changeListenerCallback (void*) } if (openness != 0) - { tree->restoreOpennessState (*openness); - delete openness; - } } class KeyEntryWindow : public AlertWindow @@ -60439,7 +60241,7 @@ bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefaultSet) const { - KeyPressMappingSet* defaultSet = 0; + ScopedPointer defaultSet; if (saveDifferencesFromDefaultSet) { @@ -60492,8 +60294,6 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault } } } - - delete defaultSet; } return doc; @@ -61198,10 +60998,6 @@ ComponentMovementWatcher::~ComponentMovementWatcher() component->removeComponentListener (this); unregister(); - -#ifdef JUCE_DEBUG - delete deletionWatcher; -#endif } void ComponentMovementWatcher::componentParentHierarchyChanged (Component&) @@ -63302,10 +63098,7 @@ void TabbedButtonBar::removeTab (const int tabIndex) tabs.remove (tabIndex); tabColours.remove (tabIndex); - TabBarButton* const tb = getTabButton (tabIndex); - - if (tb != 0) - delete tb; + delete getTabButton (tabIndex); for (int i = tabIndex + 1; i <= tabs.size(); ++i) { @@ -67780,8 +67573,7 @@ MenuBarComponent::MenuBarComponent (MenuBarModel* model_) indexToShowAgain (-1), lastMouseX (0), lastMouseY (0), - inModalState (false), - currentPopup (0) + inModalState (false) { setRepaintsOnMouseActivity (true); setWantsKeyboardFocus (false); @@ -67795,7 +67587,7 @@ MenuBarComponent::~MenuBarComponent() setModel (0); Desktop::getInstance().removeGlobalMouseListener (this); - deleteAndZero (currentPopup); + currentPopup = 0; } void MenuBarComponent::setModel (MenuBarModel* const newModel) @@ -67896,7 +67688,7 @@ void MenuBarComponent::updateItemUnderMouse (int x, int y) void MenuBarComponent::hideCurrentMenu() { - deleteAndZero (currentPopup); + currentPopup = 0; repaint(); } @@ -67914,12 +67706,12 @@ void MenuBarComponent::showMenu (int index) indexToShowAgain = -1; currentPopupIndex = -1; itemUnderMouse = index; - deleteAndZero (currentPopup); + currentPopup = 0; menuBarItemsChanged (0); Component* const prevFocused = getCurrentlyFocusedComponent(); - ComponentDeletionWatcher* prevCompDeletionChecker = 0; + ScopedPointer prevCompDeletionChecker; if (prevFocused != 0) prevCompDeletionChecker = new ComponentDeletionWatcher (prevFocused); @@ -67969,13 +67761,10 @@ void MenuBarComponent::showMenu (int index) result = currentPopup->runModalLoop(); if (deletionChecker.hasBeenDeleted()) - { - delete prevCompDeletionChecker; return; - } const int lastPopupIndex = currentPopupIndex; - deleteAndZero (currentPopup); + currentPopup = 0; currentPopupIndex = -1; if (result != 0) @@ -68003,13 +67792,8 @@ void MenuBarComponent::showMenu (int index) inModalState = false; exitModalState (0); - if (prevCompDeletionChecker != 0) - { - if (! prevCompDeletionChecker->hasBeenDeleted()) - prevFocused->grabKeyboardFocus(); - - delete prevCompDeletionChecker; - } + if (prevCompDeletionChecker != 0 && ! prevCompDeletionChecker->hasBeenDeleted()) + prevFocused->grabKeyboardFocus(); int mx, my; getMouseXYRelative (mx, my); @@ -68078,7 +67862,7 @@ void MenuBarComponent::mouseUp (const MouseEvent& e) updateItemUnderMouse (e2.x, e2.y); - if (itemUnderMouse < 0 && dynamic_cast (currentPopup) != 0) + if (itemUnderMouse < 0 && dynamic_cast ((Component*) currentPopup) != 0) hideCurrentMenu(); } @@ -68271,9 +68055,9 @@ public: String text; const Colour textColour; const bool active, isSeparator, isTicked, usesColour; - Image* image; + ScopedPointer image; PopupMenuCustomComponent* const customComp; - PopupMenu* subMenu; + ScopedPointer subMenu; ApplicationCommandManager* const commandManager; MenuItemInfo() throw() @@ -68282,9 +68066,7 @@ public: isSeparator (true), isTicked (false), usesColour (false), - image (0), customComp (0), - subMenu (0), commandManager (0) { } @@ -68306,11 +68088,11 @@ public: isSeparator (false), isTicked (isTicked_), usesColour (usesColour_), - image (0), customComp (customComp_), commandManager (commandManager_) { - subMenu = (subMenu_ != 0) ? new PopupMenu (*subMenu_) : 0; + if (subMenu_ != 0) + subMenu = new PopupMenu (*subMenu_); if (customComp != 0) customComp->refCount_++; @@ -68358,13 +68140,9 @@ public: { if (other.subMenu != 0) subMenu = new PopupMenu (*(other.subMenu)); - else - subMenu = 0; if (other.image != 0) image = other.image->createCopy(); - else - image = 0; if (customComp != 0) customComp->refCount_++; @@ -68372,9 +68150,6 @@ public: ~MenuItemInfo() throw() { - delete subMenu; - delete image; - if (customComp != 0 && --(customComp->refCount_) == 0) delete customComp; } @@ -68510,7 +68285,6 @@ public: menuBarComponent (0), managerOfChosenCommand (0), componentAttachedTo (0), - attachedCompWatcher (0), lastMouseX (0), lastMouseY (0), minimumWidth (0), @@ -68551,7 +68325,7 @@ public: delete activeSubMenu; deleteAllChildren(); - delete attachedCompWatcher; + attachedCompWatcher = 0; } static PopupMenuWindow* create (const PopupMenu& menu, @@ -68572,7 +68346,7 @@ public: { int totalItems = 0; - PopupMenuWindow* const mw = new PopupMenuWindow(); + ScopedPointer mw (new PopupMenuWindow()); mw->setLookAndFeel (menu.lookAndFeel); mw->setWantsKeyboardFocus (false); mw->minimumWidth = minimumWidth; @@ -68588,17 +68362,12 @@ public: ++totalItems; } - if (totalItems == 0) - { - delete mw; - } - else + if (totalItems > 0) { mw->owner = owner_; mw->menuBarComponent = menuBarComponent; mw->managerOfChosenCommand = managerOfChosenCommand; mw->componentAttachedTo = componentAttachedTo; - delete mw->attachedCompWatcher; mw->attachedCompWatcher = componentAttachedTo != 0 ? new ComponentDeletionWatcher (componentAttachedTo) : 0; mw->calculateWindowPos (minX, maxX, minY, maxY, alignToRectangle); @@ -68617,7 +68386,7 @@ public: mw->addToDesktop (ComponentPeer::windowIsTemporary | mw->getLookAndFeel().getMenuWindowFlags()); - return mw; + return mw.release(); } } @@ -68983,7 +68752,7 @@ private: Component* menuBarComponent; ApplicationCommandManager** managerOfChosenCommand; Component* componentAttachedTo; - ComponentDeletionWatcher* attachedCompWatcher; + ScopedPointer attachedCompWatcher; Rectangle windowPos; int lastMouseX, lastMouseY; int minimumWidth, maximumNumColumns, standardItemHeight; @@ -69542,10 +69311,7 @@ PopupMenu::~PopupMenu() throw() void PopupMenu::clear() throw() { for (int i = items.size(); --i >= 0;) - { - MenuItemInfo* const mi = (MenuItemInfo*) items.getUnchecked(i); - delete mi; - } + delete (MenuItemInfo*) items.getUnchecked(i); items.clear(); separatorPending = false; @@ -69810,29 +69576,28 @@ int PopupMenu::showMenu (const int x, const int y, const int w, const int h, { Component* const prevFocused = Component::getCurrentlyFocusedComponent(); - ComponentDeletionWatcher* deletionChecker1 = 0; + ScopedPointer deletionChecker[2]; if (prevFocused != 0) - deletionChecker1 = new ComponentDeletionWatcher (prevFocused); + deletionChecker[0] = new ComponentDeletionWatcher (prevFocused); Component* const prevTopLevel = (prevFocused != 0) ? prevFocused->getTopLevelComponent() : 0; - ComponentDeletionWatcher* deletionChecker2 = 0; if (prevTopLevel != 0) - deletionChecker2 = new ComponentDeletionWatcher (prevTopLevel); + deletionChecker[1] = new ComponentDeletionWatcher (prevTopLevel); wasHiddenBecauseOfAppChange = false; int result = 0; ApplicationCommandManager* managerOfChosenCommand = 0; - Component* const popupComp = createMenuComponent (x, y, w, h, - itemIdThatMustBeVisible, - minimumWidth, - maximumNumColumns > 0 ? maximumNumColumns : 7, - standardItemHeight, - alignToRectangle, 0, - &managerOfChosenCommand, - componentAttachedTo); + ScopedPointer popupComp (createMenuComponent (x, y, w, h, + itemIdThatMustBeVisible, + minimumWidth, + maximumNumColumns > 0 ? maximumNumColumns : 7, + standardItemHeight, + alignToRectangle, 0, + &managerOfChosenCommand, + componentAttachedTo)); if (popupComp != 0) { @@ -69841,21 +69606,18 @@ int PopupMenu::showMenu (const int x, const int y, const int w, const int h, // be stuck behind other comps that are already modal.. result = popupComp->runModalLoop(); - delete popupComp; + popupComp = 0; if (! wasHiddenBecauseOfAppChange) { - if (deletionChecker2 != 0 && ! deletionChecker2->hasBeenDeleted()) + if (deletionChecker[1] != 0 && ! deletionChecker[1]->hasBeenDeleted()) prevTopLevel->toFront (true); - if (deletionChecker1 != 0 && ! deletionChecker1->hasBeenDeleted()) + if (deletionChecker[0] != 0 && ! deletionChecker[0]->hasBeenDeleted()) prevFocused->grabKeyboardFocus(); } } - delete deletionChecker1; - delete deletionChecker2; - if (managerOfChosenCommand != 0 && result != 0) { ApplicationCommandTarget::InvocationInfo info (result); @@ -70140,15 +69902,13 @@ class DragImageComponent : public Component, public Timer { private: - Image* image; + ScopedPointer image; Component* const source; DragAndDropContainer* const owner; - ComponentDeletionWatcher* sourceWatcher; + ScopedPointer sourceWatcher, mouseDragSourceWatcher, currentlyOverWatcher; Component* mouseDragSource; - ComponentDeletionWatcher* mouseDragSourceWatcher; DragAndDropTarget* currentlyOver; - ComponentDeletionWatcher* currentlyOverWatcher; String dragDesc; const int imageX, imageY; @@ -70167,7 +69927,6 @@ public: source (s), owner (o), currentlyOver (0), - currentlyOverWatcher (0), dragDesc (desc), imageX (imageX_), imageY (imageY_), @@ -70194,8 +69953,8 @@ public: ~DragImageComponent() { - if (owner->dragImageComponent == this) - owner->dragImageComponent = 0; + if ((DragImageComponent*) owner->dragImageComponent == this) + owner->dragImageComponent.release(); if (! mouseDragSourceWatcher->hasBeenDeleted()) { @@ -70205,11 +69964,6 @@ public: if (currentlyOver->isInterestedInDragSource (dragDesc, source)) currentlyOver->itemDragExit (dragDesc, source); } - - delete mouseDragSourceWatcher; - delete sourceWatcher; - delete image; - delete currentlyOverWatcher; } void paint (Graphics& g) @@ -70316,8 +70070,8 @@ public: // a modal loop and deletes this object before the method completes) const String dragDescLocal (dragDesc); + currentlyOverWatcher = 0; currentlyOver = 0; - deleteAndZero (currentlyOverWatcher); ddt->itemDropped (dragDescLocal, source, relX, relY); } @@ -70363,7 +70117,7 @@ public: } currentlyOver = ddt; - deleteAndZero (currentlyOverWatcher); + currentlyOverWatcher = 0; if (ddt != 0) { @@ -70376,7 +70130,7 @@ public: else if (currentlyOverWatcher != 0 && currentlyOverWatcher->hasBeenDeleted()) { currentlyOver = 0; - deleteAndZero (currentlyOverWatcher); + currentlyOverWatcher = 0; } if (currentlyOver != 0 @@ -70435,26 +70189,23 @@ public: }; DragAndDropContainer::DragAndDropContainer() - : dragImageComponent (0) { } DragAndDropContainer::~DragAndDropContainer() { - delete dragImageComponent; + dragImageComponent = 0; } void DragAndDropContainer::startDragging (const String& sourceDescription, Component* sourceComponent, - Image* im, + Image* dragImage_, const bool allowDraggingToExternalWindows, const Point* imageOffsetFromMouse) { - if (dragImageComponent != 0) - { - delete im; - } - else + ScopedPointer dragImage (dragImage_); + + if (dragImageComponent == 0) { Component* const thisComp = dynamic_cast (this); @@ -70464,35 +70215,34 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, Desktop::getLastMouseDownPosition (mx, my); int imageX = 0, imageY = 0; - if (im == 0) + if (dragImage == 0) { - im = sourceComponent->createComponentSnapshot (Rectangle (0, 0, sourceComponent->getWidth(), sourceComponent->getHeight())); + dragImage = sourceComponent->createComponentSnapshot (Rectangle (0, 0, sourceComponent->getWidth(), sourceComponent->getHeight())); - if (im->getFormat() != Image::ARGB) + if (dragImage->getFormat() != Image::ARGB) { - Image* newIm = Image::createNativeImage (Image::ARGB, im->getWidth(), im->getHeight(), true); + Image* newIm = Image::createNativeImage (Image::ARGB, dragImage->getWidth(), dragImage->getHeight(), true); Graphics g2 (*newIm); - g2.drawImageAt (im, 0, 0); + g2.drawImageAt (dragImage, 0, 0); - delete im; - im = newIm; + dragImage = newIm; } - im->multiplyAllAlphas (0.6f); + dragImage->multiplyAllAlphas (0.6f); const int lo = 150; const int hi = 400; int rx = mx, ry = my; sourceComponent->globalPositionToRelative (rx, ry); - const int cx = jlimit (0, im->getWidth(), rx); - const int cy = jlimit (0, im->getHeight(), ry); + const int cx = jlimit (0, dragImage->getWidth(), rx); + const int cy = jlimit (0, dragImage->getHeight(), ry); - for (int y = im->getHeight(); --y >= 0;) + for (int y = dragImage->getHeight(); --y >= 0;) { const double dy = (y - cy) * (y - cy); - for (int x = im->getWidth(); --x >= 0;) + for (int x = dragImage->getWidth(); --x >= 0;) { const int dx = x - cx; const int distance = roundDoubleToInt (sqrt (dx * dx + dy)); @@ -70503,7 +70253,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, : (hi - distance) / (float) (hi - lo) + Random::getSystemRandom().nextFloat() * 0.008f; - im->multiplyAlphaAt (x, y, alpha); + dragImage->multiplyAlphaAt (x, y, alpha); } } } @@ -70515,8 +70265,8 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, { if (imageOffsetFromMouse == 0) { - imageX = im->getWidth() / -2; - imageY = im->getHeight() / -2; + imageX = dragImage->getWidth() / -2; + imageY = dragImage->getHeight() / -2; } else { @@ -70525,35 +70275,31 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, } } - DragImageComponent* const dic - = new DragImageComponent (im, sourceDescription, sourceComponent, - this, imageX, imageY); + dragImageComponent = new DragImageComponent (dragImage.release(), sourceDescription, sourceComponent, + this, imageX, imageY); - dragImageComponent = dic; currentDragDesc = sourceDescription; if (allowDraggingToExternalWindows) { if (! Desktop::canUseSemiTransparentWindows()) - dic->setOpaque (true); + dragImageComponent->setOpaque (true); - dic->addToDesktop (ComponentPeer::windowIgnoresMouseClicks - | ComponentPeer::windowIsTemporary - | ComponentPeer::windowIgnoresKeyPresses); + dragImageComponent->addToDesktop (ComponentPeer::windowIgnoresMouseClicks + | ComponentPeer::windowIsTemporary + | ComponentPeer::windowIgnoresKeyPresses); } else - thisComp->addChildComponent (dic); + thisComp->addChildComponent (dragImageComponent); - dic->updateLocation (false, mx, my); - dic->setVisible (true); + ((DragImageComponent*) dragImageComponent)->updateLocation (false, mx, my); + dragImageComponent->setVisible (true); } else { // this class must only be implemented by an object that // is also a Component. jassertfalse - - delete im; } } } @@ -73242,8 +72988,7 @@ public: : owner (owner_), h (h_), s (s_), v (v_), lastHue (0.0f), - edge (edgeSize), - colours (0) + edge (edgeSize) { addAndMakeVisible (marker = new ColourSpaceMarker()); setMouseCursor (MouseCursor::CrosshairCursor); @@ -73252,7 +72997,6 @@ public: ~ColourSpaceView() { deleteAllChildren(); - delete colours; } void paint (Graphics& g) @@ -73303,7 +73047,7 @@ public: if (lastHue != h) { lastHue = h; - deleteAndZero (colours); + colours = 0; repaint(); } @@ -73312,12 +73056,12 @@ public: void resized() { - deleteAndZero (colours); + colours = 0; updateMarker(); } private: - Image* colours; + ScopedPointer colours; void updateMarker() const throw() { @@ -73703,10 +73447,7 @@ void ColourSelector::resized() { int i; for (i = swatchComponents.size(); --i >= 0;) - { - SwatchComponent* const sc = (SwatchComponent*) swatchComponents.getUnchecked(i); - delete sc; - } + delete (SwatchComponent*) swatchComponents.getUnchecked(i); for (i = 0; i < numSwatches; ++i) { @@ -75514,13 +75255,13 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE PreferencesPanel::PreferencesPanel() - : currentPage (0), - buttonSize (70) + : buttonSize (70) { } PreferencesPanel::~PreferencesPanel() { + currentPage = 0; deleteAllChildren(); } @@ -75629,7 +75370,7 @@ void PreferencesPanel::setCurrentPage (const String& pageName) { currentPageName = pageName; - deleteAndZero (currentPage); + currentPage = 0; currentPage = createComponentForPage (pageName); if (currentPage != 0) @@ -76254,14 +75995,12 @@ private: LookAndFeel& lf = associatedComponent->isValidComponent() ? associatedComponent->getLookAndFeel() : LookAndFeel::getDefaultLookAndFeel(); - Component* const alertBox = lf.createAlertWindow (title, message, button1, button2, button3, - iconType, numButtons, associatedComponent); + ScopedPointer alertBox (lf.createAlertWindow (title, message, button1, button2, button3, + iconType, numButtons, associatedComponent)); jassert (alertBox != 0); // you have to return one of these! - const int result = alertBox->runModalLoop(); - delete alertBox; - return result; + return alertBox->runModalLoop(); } static void* showCallback (void* userData) @@ -76357,7 +76096,6 @@ ComponentPeer::ComponentPeer (Component* const component_, lastPaintTime (0), constrainer (0), lastFocusedComponent (0), - dragAndDropTargetComponent (0), lastDragAndDropCompUnderMouse (0), fakeMouseMessageSent (false), isWindowMinimised (false) @@ -76368,7 +76106,6 @@ ComponentPeer::ComponentPeer (Component* const component_, ComponentPeer::~ComponentPeer() { heavyweightPeers.removeValue (this); - delete dragAndDropTargetComponent; Desktop::getInstance().triggerFocusCallback(); } @@ -76975,7 +76712,7 @@ void ComponentPeer::handleFileDragMove (const StringArray& files, int x, int y) if (lastTarget != 0) lastTarget->fileDragExit (files); - deleteAndZero (dragAndDropTargetComponent); + dragAndDropTargetComponent = 0; if (newTarget != 0) { @@ -77018,7 +76755,7 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, int x, int y) { FileDragAndDropTarget* const target = const_cast (dynamic_cast (dragAndDropTargetComponent->getComponent())); - deleteAndZero (dragAndDropTargetComponent); + dragAndDropTargetComponent = 0; lastDragAndDropCompUnderMouse = 0; if (target != 0) @@ -77173,12 +76910,8 @@ DocumentWindow::DocumentWindow (const String& title, positionTitleBarButtonsOnLeft (false), #endif drawTitleTextCentred (true), - titleBarIcon (0), - menuBar (0), menuBarModel (0) { - zeromem (titleBarButtons, sizeof (titleBarButtons)); - setResizeLimits (128, 128, 32768, 32768); lookAndFeelChanged(); @@ -77186,11 +76919,10 @@ DocumentWindow::DocumentWindow (const String& title, DocumentWindow::~DocumentWindow() { - for (int i = 0; i < 3; ++i) - delete titleBarButtons[i]; + for (int i = numElementsInArray (titleBarButtons); --i >= 0;) + titleBarButtons[i] = 0; - delete titleBarIcon; - delete menuBar; + menuBar = 0; } void DocumentWindow::repaintTitleBar() @@ -77211,11 +76943,7 @@ void DocumentWindow::setName (const String& newName) void DocumentWindow::setIcon (const Image* imageToUse) { - deleteAndZero (titleBarIcon); - - if (imageToUse != 0) - titleBarIcon = imageToUse->createCopy(); - + titleBarIcon = imageToUse != 0 ? imageToUse->createCopy() : 0; repaintTitleBar(); } @@ -77245,7 +76973,6 @@ void DocumentWindow::setMenuBar (MenuBarModel* menuBarModel_, { if (menuBarModel != menuBarModel_) { - delete menuBar; menuBar = 0; menuBarModel = menuBarModel_; @@ -77423,8 +77150,8 @@ int DocumentWindow::getDesktopWindowStyleFlags() const void DocumentWindow::lookAndFeelChanged() { int i; - for (i = 0; i < 3; ++i) - deleteAndZero (titleBarButtons[i]); + for (i = numElementsInArray (titleBarButtons); --i >= 0;) + titleBarButtons[i] = 0; if (! isUsingNativeTitleBar()) { @@ -77474,7 +77201,7 @@ void DocumentWindow::activeWindowStatusChanged() { ResizableWindow::activeWindowStatusChanged(); - for (int i = 0; i < 3; ++i) + for (int i = numElementsInArray (titleBarButtons); --i >= 0;) if (titleBarButtons[i] != 0) titleBarButtons[i]->setEnabled (isActiveWindow()); @@ -77526,9 +77253,6 @@ BEGIN_JUCE_NAMESPACE ResizableWindow::ResizableWindow (const String& name, const bool addToDesktop_) : TopLevelWindow (name, addToDesktop_), - resizableCorner (0), - resizableBorder (0), - contentComponent (0), resizeToFitContent (false), fullscreen (false), lastNonFullScreenPos (50, 50, 256, 256), @@ -77549,9 +77273,6 @@ ResizableWindow::ResizableWindow (const String& name, const Colour& backgroundColour_, const bool addToDesktop_) : TopLevelWindow (name, addToDesktop_), - resizableCorner (0), - resizableBorder (0), - contentComponent (0), resizeToFitContent (false), fullscreen (false), lastNonFullScreenPos (50, 50, 256, 256), @@ -77570,9 +77291,9 @@ ResizableWindow::ResizableWindow (const String& name, ResizableWindow::~ResizableWindow() { - deleteAndZero (resizableCorner); - deleteAndZero (resizableBorder); - deleteAndZero (contentComponent); + resizableCorner = 0; + resizableBorder = 0; + contentComponent = 0; // have you been adding your own components directly to this window..? tut tut tut. // Read the instructions for using a ResizableWindow! @@ -77595,12 +77316,10 @@ void ResizableWindow::setContentComponent (Component* const newContentComponent, { resizeToFitContent = resizeToFit; - if (contentComponent != newContentComponent) + if (newContentComponent != (Component*) contentComponent) { - if (deleteOldOne) - delete contentComponent; - else - removeChildComponent (contentComponent); + if (! deleteOldOne) + removeChildComponent (contentComponent.release()); contentComponent = newContentComponent; @@ -77708,7 +77427,7 @@ void ResizableWindow::setResizable (const bool shouldBeResizable, { if (useBottomRightCornerResizer) { - deleteAndZero (resizableBorder); + resizableBorder = 0; if (resizableCorner == 0) { @@ -77718,7 +77437,7 @@ void ResizableWindow::setResizable (const bool shouldBeResizable, } else { - deleteAndZero (resizableCorner); + resizableCorner = 0; if (resizableBorder == 0) Component::addChildComponent (resizableBorder = new ResizableBorderComponent (this, constrainer)); @@ -77726,8 +77445,8 @@ void ResizableWindow::setResizable (const bool shouldBeResizable, } else { - deleteAndZero (resizableCorner); - deleteAndZero (resizableBorder); + resizableCorner = 0; + resizableBorder = 0; } if (isUsingNativeTitleBar()) @@ -77769,8 +77488,8 @@ void ResizableWindow::setConstrainer (ComponentBoundsConstrainer* newConstrainer const bool useBottomRightCornerResizer = resizableCorner != 0; const bool shouldBeResizable = useBottomRightCornerResizer || resizableBorder != 0; - deleteAndZero (resizableCorner); - deleteAndZero (resizableBorder); + resizableCorner = 0; + resizableBorder = 0; setResizable (shouldBeResizable, useBottomRightCornerResizer); @@ -78063,18 +77782,14 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE SplashScreen::SplashScreen() - : backgroundImage (0), - isImageInCache (false) + : backgroundImage (0) { setOpaque (true); } SplashScreen::~SplashScreen() { - if (isImageInCache) - ImageCache::release (backgroundImage); - else - delete backgroundImage; + ImageCache::releaseOrDelete (backgroundImage); } void SplashScreen::show (const String& title, @@ -78089,8 +77804,6 @@ void SplashScreen::show (const String& title, if (backgroundImage_ != 0) { - isImageInCache = ImageCache::isImageInCache (backgroundImage_); - setOpaque (! backgroundImage_->hasAlphaChannel()); show (title, @@ -78179,7 +77892,6 @@ ThreadWithProgressWindow::ThreadWithProgressWindow (const String& title, ThreadWithProgressWindow::~ThreadWithProgressWindow() { stopThread (timeOutMsWhenCancelling); - delete alertWindow; } bool ThreadWithProgressWindow::runThread (const int priority) @@ -78501,8 +78213,7 @@ TopLevelWindow::TopLevelWindow (const String& name, : Component (name), useDropShadow (true), useNativeTitleBar (false), - windowIsActive_ (false), - shadower (0) + windowIsActive_ (false) { setOpaque (true); @@ -78518,7 +78229,7 @@ TopLevelWindow::TopLevelWindow (const String& name, TopLevelWindow::~TopLevelWindow() { - deleteAndZero (shadower); + shadower = 0; TopLevelWindowManager::getInstance()->removeWindow (this); } @@ -78573,7 +78284,7 @@ void TopLevelWindow::setDropShadowEnabled (const bool useShadow) if (isOnDesktop()) { - deleteAndZero (shadower); + shadower = 0; Component::addToDesktop (getDesktopWindowStyleFlags()); } else @@ -78590,7 +78301,7 @@ void TopLevelWindow::setDropShadowEnabled (const bool useShadow) } else { - deleteAndZero (shadower); + shadower = 0; } } } @@ -80367,12 +80078,12 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE FillType::FillType() throw() - : colour (0xff000000), gradient (0), image (0) + : colour (0xff000000), image (0) { } FillType::FillType (const Colour& colour_) throw() - : colour (colour_), gradient (0), image (0) + : colour (colour_), image (0) { } @@ -80382,8 +80093,7 @@ FillType::FillType (const ColourGradient& gradient_) throw() } FillType::FillType (const Image& image_, const AffineTransform& transform_) throw() - : colour (0xff000000), gradient (0), - image (&image_), transform (transform_) + : colour (0xff000000), image (&image_), transform (transform_) { } @@ -80399,7 +80109,6 @@ const FillType& FillType::operator= (const FillType& other) throw() if (this != &other) { colour = other.colour; - delete gradient; gradient = (other.gradient != 0 ? new ColourGradient (*other.gradient) : 0); image = other.image; transform = other.transform; @@ -80410,12 +80119,11 @@ const FillType& FillType::operator= (const FillType& other) throw() FillType::~FillType() throw() { - delete gradient; } void FillType::setColour (const Colour& newColour) throw() { - deleteAndZero (gradient); + gradient = 0; image = 0; colour = newColour; } @@ -80436,7 +80144,7 @@ void FillType::setGradient (const ColourGradient& newGradient) throw() void FillType::setTiledImage (const Image& image_, const AffineTransform& transform_) throw() { - deleteAndZero (gradient); + gradient = 0; image = &image_; transform = transform_; colour = Colours::black; @@ -83055,7 +82763,6 @@ LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (Image& image LowLevelGraphicsSoftwareRenderer::~LowLevelGraphicsSoftwareRenderer() { - delete currentState; } bool LowLevelGraphicsSoftwareRenderer::isVectorDevice() const @@ -83121,7 +82828,6 @@ void LowLevelGraphicsSoftwareRenderer::restoreState() if (top != 0) { - delete currentState; currentState = top; stateStack.removeLast (1, false); } @@ -83265,8 +82971,8 @@ public: class CachedGlyph { public: - CachedGlyph() throw() : glyph (0), lastAccessCount (0), edgeTable (0) {} - ~CachedGlyph() throw() { delete edgeTable; } + CachedGlyph() : glyph (0), lastAccessCount (0) {} + ~CachedGlyph() {} void draw (LLGCSavedState& state, Image& image, const float x, const float y) const throw() { @@ -83282,7 +82988,7 @@ public: { font = newFont; glyph = glyphNumber; - deleteAndZero (edgeTable); + edgeTable = 0; Path glyphPath; font.getTypeface()->getOutlineForGlyph (glyphNumber, glyphPath); @@ -83308,7 +83014,7 @@ public: juce_UseDebuggingNewOperator private: - EdgeTable* edgeTable; + ScopedPointer edgeTable; CachedGlyph (const CachedGlyph&); const CachedGlyph& operator= (const CachedGlyph&); @@ -83540,20 +83246,15 @@ Drawable* Drawable::createFromImageData (const void* data, const int numBytes) const String asString (String::createStringFromData (data, numBytes)); XmlDocument doc (asString); - XmlElement* const outer = doc.getDocumentElement (true); + ScopedPointer outer (doc.getDocumentElement (true)); if (outer != 0 && outer->hasTagName (T("svg"))) { - XmlElement* const svg = doc.getDocumentElement(); + ScopedPointer svg (doc.getDocumentElement()); if (svg != 0) - { result = Drawable::createFromSVG (*svg); - delete svg; - } } - - delete outer; } return result; @@ -83569,15 +83270,9 @@ Drawable* Drawable::createFromImageDataStream (InputStream& dataSource) Drawable* Drawable::createFromImageFile (const File& file) { - FileInputStream* fin = file.createInputStream(); - - if (fin == 0) - return 0; + const ScopedPointer fin (file.createInputStream()); - Drawable* d = createFromImageDataStream (*fin); - delete fin; - - return d; + return fin != 0 ? createFromImageDataStream (*fin) : 0; } Drawable* Drawable::createFromValueTree (const ValueTree& tree) throw() @@ -83850,12 +83545,7 @@ DrawableImage::~DrawableImage() void DrawableImage::clearImage() { if (canDeleteImage && image != 0) - { - if (ImageCache::isImageInCache (image)) - ImageCache::release (image); - else - delete image; - } + ImageCache::releaseOrDelete (image); image = 0; } @@ -87011,10 +86701,7 @@ TextLayout::~TextLayout() throw() void TextLayout::clear() throw() { for (int i = tokens.size(); --i >= 0;) - { - TextLayoutToken* const t = (TextLayoutToken*)tokens.getUnchecked(i); - delete t; - } + delete (TextLayoutToken*) tokens.getUnchecked(i); tokens.clear(); totalLines = 0; @@ -92486,7 +92173,7 @@ ImageCache::~ImageCache() for (int i = images.size(); --i >= 0;) { - CachedImageInfo* const ci = (CachedImageInfo*)(images.getUnchecked(i)); + CachedImageInfo* const ci = (CachedImageInfo*) images.getUnchecked(i); delete ci->image; delete ci; } @@ -92561,6 +92248,14 @@ void ImageCache::release (Image* const imageToRelease) } } +void ImageCache::releaseOrDelete (Image* const imageToRelease) +{ + if (isImageInCache (imageToRelease)) + release (imageToRelease); + else + delete imageToRelease; +} + bool ImageCache::isImageInCache (Image* const imageToLookFor) { if (instance != 0) @@ -92744,7 +92439,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, int dw, int dh) const { - Image* imageCreated = 0; + ScopedPointer imageCreated; if (sourceImage == 0) { @@ -92891,8 +92586,6 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, } } } - - delete imageCreated; } END_JUCE_NAMESPACE @@ -93061,10 +92754,8 @@ public: Image* decodeImage (InputStream& in) { - GIFLoader* const loader = new GIFLoader (in); - Image* const im = loader->getImage(); - delete loader; - return im; + const ScopedPointer loader (new GIFLoader (in)); + return loader->getImage(); } bool writeImageToStream (const Image& /*sourceImage*/, OutputStream& /*destStream*/) @@ -95369,8 +95060,7 @@ GZIPCompressorOutputStream::~GZIPCompressorOutputStream() { flush(); - GZIPCompressorHelper* const h = (GZIPCompressorHelper*) helper; - delete h; + delete (GZIPCompressorHelper*) helper; if (deleteDestStream) delete destStream; @@ -102767,8 +102457,7 @@ GZIPDecompressorInputStream::~GZIPDecompressorInputStream() if (deleteSourceWhenDestroyed) delete sourceStream; - GZIPDecompressHelper* const h = (GZIPDecompressHelper*) helper; - delete h; + delete (GZIPDecompressHelper*) helper; } int64 GZIPDecompressorInputStream::getTotalLength() @@ -102856,8 +102545,7 @@ bool GZIPDecompressorInputStream::setPosition (int64 newPos) else { // reset the stream and start again.. - GZIPDecompressHelper* const h = (GZIPDecompressHelper*) helper; - delete h; + delete (GZIPDecompressHelper*) helper; isEof = false; activeBufferSize = 0; @@ -185016,12 +184704,12 @@ int OggVorbisAudioFormat::estimateOggFileQuality (const File& source) if (in != 0) { - AudioFormatReader* const r = createReaderFor (in, true); + ScopedPointer r (createReaderFor (in, true)); if (r != 0) { const int64 numSamps = r->lengthInSamples; - delete r; + r = 0; const int64 fileNumSamps = source.getSize() / 4; const double ratio = numSamps / (double) fileNumSamps; @@ -236659,9 +236347,8 @@ static LRESULT CALLBACK juce_MessageWndProc (HWND h, } else if (message == broadcastId) { - String* const messageString = (String*) lParam; + const ScopedPointer messageString ((String*) lParam); MessageManager::getInstance()->deliverBroadcastMessage (*messageString); - delete messageString; return 0; } else if (message == WM_COPYDATA && ((const COPYDATASTRUCT*) lParam)->dwData == broadcastId) @@ -239506,9 +239193,8 @@ void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) thro 16,0,0,2,52,148,47,0,200,185,16,130,90,12,74,139,107,84,123,39, 132,117,151,116,132,146,248,60,209,138, 98,22,203,114,34,236,37,52,77,217,247,154,191,119,110,240,193,128,193,95,163,56,60,234,98,135,2,0,59 }; - Image* const image = ImageFileFormat::loadFrom ((const char*) dragHandData, sizeof (dragHandData)); + const ScopedPointer image (ImageFileFormat::loadFrom ((const char*) dragHandData, sizeof (dragHandData))); dragHandCursor = juce_createMouseCursorFromImage (*image, 8, 7); - delete image; } return dragHandCursor; @@ -241081,7 +240767,7 @@ bool ActiveXControlComponent::createControl (const void* controlIID) HWND hwnd = (HWND) peer->getNativeHandle(); - ActiveXControlData* const info = new ActiveXControlData (hwnd, this); + ScopedPointer info (new ActiveXControlData (hwnd, this)); HRESULT hr; if ((hr = OleCreate (*(const IID*) controlIID, IID_IOleObject, 1 /*OLERENDER_DRAW*/, 0, @@ -241100,7 +240786,7 @@ bool ActiveXControlComponent::createControl (const void* controlIID) if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) { - control = info; + control = info.release(); setControlBounds (Rectangle (x, y, getWidth(), getHeight())); info->controlHWND = getHWND (this); @@ -241115,8 +240801,6 @@ bool ActiveXControlComponent::createControl (const void* controlIID) } } } - - delete info; } return false; @@ -245127,27 +244811,23 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call } } - MidiInput* const in = new MidiInput (name); - MidiInThread* const thread = new MidiInThread (in, callback); + ScopedPointer in (new MidiInput (name)); + ScopedPointer thread (new MidiInThread (in, callback)); HMIDIIN h; HRESULT err = midiInOpen (&h, deviceId, (DWORD_PTR) &midiInCallback, - (DWORD_PTR) thread, + (DWORD_PTR) (MidiInThread*) thread, CALLBACK_FUNCTION); if (err == MMSYSERR_NOERROR) { thread->hIn = h; - in->internal = (void*) thread; - return in; - } - else - { - delete in; - delete thread; - return 0; + in->internal = (void*) thread.release(); + return in.release(); } + + return 0; } MidiInput::MidiInput (const String& name_) @@ -254417,7 +254097,6 @@ public: destroyWindow(); windowH = 0; - delete repainter; } void* getNativeHandle() const @@ -255445,7 +255124,6 @@ private: public: LinuxRepaintManager (LinuxComponentPeer* const peer_) : peer (peer_), - image (0), lastTimeImageUsed (0) { #if JUCE_USE_XSHM @@ -255467,7 +255145,6 @@ private: ~LinuxRepaintManager() { - delete image; } void timerCallback() @@ -255480,7 +255157,7 @@ private: else if (Time::getApproximateMillisecondCounter() > lastTimeImageUsed + 3000) { stopTimer(); - deleteAndZero (image); + image = 0; } } @@ -255503,8 +255180,6 @@ private: if (image == 0 || image->getWidth() < totalArea.getWidth() || image->getHeight() < totalArea.getHeight()) { - delete image; - #if JUCE_USE_XSHM image = new XBitmapImage (useARGBImagesForRendering ? Image::ARGB : Image::RGB, @@ -255547,7 +255222,7 @@ private: private: LinuxComponentPeer* const peer; - XBitmapImage* image; + ScopedPointer image; uint32 lastTimeImageUsed; RectangleList regionsNeedingRepaint; @@ -255558,7 +255233,7 @@ private: const LinuxRepaintManager& operator= (const LinuxRepaintManager&); }; - LinuxRepaintManager* repainter; + ScopedPointer repainter; friend class LinuxRepaintManager; Window windowH, parentWindow; @@ -256520,11 +256195,8 @@ void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) thro 247,154,191,119,110,240,193,128,193,95,163,56,60,234,98,135,2,0,59 }; const int dragHandDataSize = 99; - Image* const im = ImageFileFormat::loadFrom ((const char*) dragHandData, dragHandDataSize); - void* const dragHandCursor = juce_createMouseCursorFromImage (*im, 8, 7); - delete im; - - return dragHandCursor; + const ScopedPointer im (ImageFileFormat::loadFrom ((const char*) dragHandData, dragHandDataSize)); + return juce_createMouseCursorFromImage (*im, 8, 7); } case MouseCursor::CopyingCursor: @@ -256537,11 +256209,8 @@ void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) thro 252,114,147,74,83,5,50,68,147,208,217,16,71,149,252,124,5,0,59,0,0 }; const int copyCursorSize = 119; - Image* const im = ImageFileFormat::loadFrom ((const char*) copyCursorData, copyCursorSize); - void* const copyCursor = juce_createMouseCursorFromImage (*im, 1, 3); - delete im; - - return copyCursor; + const ScopedPointer im (ImageFileFormat::loadFrom ((const char*) copyCursorData, copyCursorSize)); + return juce_createMouseCursorFromImage (*im, 1, 3); } case MouseCursor::WaitCursor: @@ -261790,9 +261459,6 @@ public: MacTypeface (const Font& font) : Typeface (font.getTypefaceName()) -#if ! SUPPORT_ONLY_10_4_FONTS - , charToGlyphMapper (0) -#endif { const ScopedAutoReleasePool pool; renderingTransform = CGAffineTransformIdentity; @@ -261920,10 +261586,6 @@ public: #endif if (fontRef != 0) CGFontRelease (fontRef); - -#if ! SUPPORT_ONLY_10_4_FONTS - delete charToGlyphMapper; -#endif } float getAscent() const @@ -262222,7 +261884,7 @@ private: } }; - CharToGlyphMapper* charToGlyphMapper; + ScopedPointer charToGlyphMapper; #endif }; @@ -262393,7 +262055,6 @@ public: CGContextRelease (context); CGColorSpaceRelease (rgbColourSpace); CGColorSpaceRelease (greyColourSpace); - delete state; } bool isVectorDevice() const { return false; } @@ -262501,7 +262162,6 @@ public: if (top != 0) { - delete state; state = top; stateStack.removeLast (1, false); } @@ -262794,7 +262454,7 @@ private: CGAffineTransform fontTransform; }; - SavedState* state; + ScopedPointer state; OwnedArray stateStack; HeapBlock gradientLookupTable; int numGradientLookupEntries; @@ -264540,17 +264200,15 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot static void* juce_cursorFromData (const unsigned char* data, const int size, float hx, float hy) throw() { - Image* const im = ImageFileFormat::loadFrom ((const char*) data, size); + ScopedPointer im (ImageFileFormat::loadFrom ((const char*) data, size)); jassert (im != 0); if (im == 0) return 0; - void* const curs = juce_createMouseCursorFromImage (*im, - (int) (hx * im->getWidth()), - (int) (hy * im->getHeight())); - delete im; - return curs; + return juce_createMouseCursorFromImage (*im, + (int) (hx * im->getWidth()), + (int) (hy * im->getHeight())); } static void* juce_cursorFromWebKitFile (const char* filename, float hx, float hy) @@ -265811,8 +265469,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) MidiOutput::~MidiOutput() { - MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*) internal; - delete mpe; + delete (MidiPortAndEndpoint*) internal; } void MidiOutput::reset() @@ -266050,7 +265707,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { MIDIPortRef port; - MidiPortAndCallback* const mpc = new MidiPortAndCallback(); + ScopedPointer mpc (new MidiPortAndCallback()); mpc->active = false; if (OK (MIDIInputPortCreate (globalMidiClient, pname, midiInputProc, mpc, &port))) @@ -266067,18 +265724,13 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) mi->internal = (void*) mpc; const ScopedLock sl (callbackLock); - activeCallbacks.add (mpc); + activeCallbacks.add (mpc.release()); } else { OK (MIDIPortDispose (port)); - delete mpc; } } - else - { - delete mpc; - } } } @@ -266095,7 +265747,7 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba if (makeSureClientExists()) { - MidiPortAndCallback* const mpc = new MidiPortAndCallback(); + ScopedPointer mpc (new MidiPortAndCallback()); mpc->active = false; MIDIEndpointRef endPoint; @@ -266112,11 +265764,7 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba mi->internal = (void*) mpc; const ScopedLock sl (callbackLock); - activeCallbacks.add (mpc); - } - else - { - delete mpc; + activeCallbacks.add (mpc.release()); } CFRelease (name); @@ -266238,9 +265886,6 @@ public: MacTypeface (const Font& font) : Typeface (font.getTypefaceName()) -#if ! SUPPORT_ONLY_10_4_FONTS - , charToGlyphMapper (0) -#endif { const ScopedAutoReleasePool pool; renderingTransform = CGAffineTransformIdentity; @@ -266368,10 +266013,6 @@ public: #endif if (fontRef != 0) CGFontRelease (fontRef); - -#if ! SUPPORT_ONLY_10_4_FONTS - delete charToGlyphMapper; -#endif } float getAscent() const @@ -266670,7 +266311,7 @@ private: } }; - CharToGlyphMapper* charToGlyphMapper; + ScopedPointer charToGlyphMapper; #endif }; @@ -266843,7 +266484,6 @@ public: CGContextRelease (context); CGColorSpaceRelease (rgbColourSpace); CGColorSpaceRelease (greyColourSpace); - delete state; } bool isVectorDevice() const { return false; } @@ -266951,7 +266591,6 @@ public: if (top != 0) { - delete state; state = top; stateStack.removeLast (1, false); } @@ -267244,7 +266883,7 @@ private: CGAffineTransform fontTransform; }; - SavedState* state; + ScopedPointer state; OwnedArray stateStack; HeapBlock gradientLookupTable; int numGradientLookupEntries; @@ -268962,17 +268601,15 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot static void* juce_cursorFromData (const unsigned char* data, const int size, float hx, float hy) throw() { - Image* const im = ImageFileFormat::loadFrom ((const char*) data, size); + ScopedPointer im (ImageFileFormat::loadFrom ((const char*) data, size)); jassert (im != 0); if (im == 0) return 0; - void* const curs = juce_createMouseCursorFromImage (*im, - (int) (hx * im->getWidth()), - (int) (hy * im->getHeight())); - delete im; - return curs; + return juce_createMouseCursorFromImage (*im, + (int) (hx * im->getWidth()), + (int) (hy * im->getHeight())); } static void* juce_cursorFromWebKitFile (const char* filename, float hx, float hy) @@ -269187,23 +268824,21 @@ private: }; NSViewComponent::NSViewComponent() - : info (0) { } NSViewComponent::~NSViewComponent() { - delete info; } void NSViewComponent::setView (void* view) { if (view != getView()) { - deleteAndZero (info); - if (view != 0) info = new NSViewComponentInternal ((NSView*) view, this); + else + info = 0; } } @@ -271033,12 +270668,12 @@ AudioCDBurner::~AudioCDBurner() AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) { - AudioCDBurner* b = new AudioCDBurner (deviceIndex); + ScopedPointer b (new AudioCDBurner (deviceIndex)); if (b->internal == 0) - deleteAndZero (b); + b = 0; - return b; + return b.release(); } static NSArray* findDiskBurnerDevices() @@ -272605,7 +272240,7 @@ public: CoreAudioInternal* getRelatedDevice() const { UInt32 size = 0; - CoreAudioInternal* result = 0; + ScopedPointer result; AudioObjectPropertyAddress pa; pa.mSelector = kAudioDevicePropertyRelatedDevices; @@ -272635,13 +272270,13 @@ public: || (result->inChanNames.size() + result->outChanNames.size()) == 0) break; - deleteAndZero (result); + result = 0; } } } } - return result; + return result.release(); } juce_UseDebuggingNewOperator @@ -273484,8 +273119,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) MidiOutput::~MidiOutput() { - MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*) internal; - delete mpe; + delete (MidiPortAndEndpoint*) internal; } void MidiOutput::reset() @@ -273723,7 +273357,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { MIDIPortRef port; - MidiPortAndCallback* const mpc = new MidiPortAndCallback(); + ScopedPointer mpc (new MidiPortAndCallback()); mpc->active = false; if (OK (MIDIInputPortCreate (globalMidiClient, pname, midiInputProc, mpc, &port))) @@ -273740,18 +273374,13 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) mi->internal = (void*) mpc; const ScopedLock sl (callbackLock); - activeCallbacks.add (mpc); + activeCallbacks.add (mpc.release()); } else { OK (MIDIPortDispose (port)); - delete mpc; } } - else - { - delete mpc; - } } } @@ -273768,7 +273397,7 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba if (makeSureClientExists()) { - MidiPortAndCallback* const mpc = new MidiPortAndCallback(); + ScopedPointer mpc (new MidiPortAndCallback()); mpc->active = false; MIDIEndpointRef endPoint; @@ -273785,11 +273414,7 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba mi->internal = (void*) mpc; const ScopedLock sl (callbackLock); - activeCallbacks.add (mpc); - } - else - { - delete mpc; + activeCallbacks.add (mpc.release()); } CFRelease (name); diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 7f88500e21..631b7d37b2 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -4933,6 +4933,158 @@ private: #ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ #define __JUCE_OWNEDARRAY_JUCEHEADER__ +/********* Start of inlined file: juce_ScopedPointer.h *********/ +#ifndef __JUCE_SCOPEDPOINTER_JUCEHEADER__ +#define __JUCE_SCOPEDPOINTER_JUCEHEADER__ + +/** + This class holds a pointer which is automatically deleted when this object goes + out of scope. + + Once a pointer has been passed to a ScopedPointer, it will make sure that the pointer + gets deleted when the ScopedPointer is deleted. Using the ScopedPointer on the stack or + as member variables is a good way to use RAII to avoid accidentally leaking dynamically + created objects. + + A ScopedPointer can be used in pretty much the same way that you'd use a normal pointer + to an object. If you use the assignment operator to assign a different object to a + ScopedPointer, the old one will be automatically deleted. + + If you need to get a pointer out of a ScopedPointer without it being deleted, you + can use the release() method. +*/ +template +class ScopedPointer +{ +public: + + /** Creates a ScopedPointer containing a null pointer. */ + inline ScopedPointer() : object (0) + { + } + + /** Creates a ScopedPointer that owns the specified object. */ + inline ScopedPointer (ObjectType* const objectToTakePossessionOf) + : object (objectToTakePossessionOf) + { + } + + /** Creates a ScopedPointer that takes its pointer from another ScopedPointer. + + Because a pointer can only belong to one ScopedPointer, this transfers + the pointer from the other object to this one, and the other object is reset to + be a null pointer. + */ + ScopedPointer (ScopedPointer& objectToTransferFrom) + : object (objectToTransferFrom.object) + { + objectToTransferFrom.object = 0; + } + + /** Destructor. + This will delete the object that this ScopedPointer currently refers to. + */ + inline ~ScopedPointer() { delete object; } + + /** Changes this ScopedPointer to point to a new object. + + Because a pointer can only belong to one ScopedPointer, this transfers + the pointer from the other object to this one, and the other object is reset to + be a null pointer. + + If this ScopedPointer already points to an object, that object + will first be deleted. + */ + const ScopedPointer& operator= (ScopedPointer& objectToTransferFrom) + { + if (this != &objectToTransferFrom) + { + // Two ScopedPointers should never be able to refer to the same object - if + // this happens, you must have done something dodgy! + jassert (object != objectToTransferFrom.object); + + ObjectType* const oldObject = object; + object = objectToTransferFrom.object; + objectToTransferFrom.object = 0; + delete oldObject; + } + + return *this; + } + + /** Changes this ScopedPointer to point to a new object. + + If this ScopedPointer already points to an object, that object + will first be deleted. + + The pointer that you pass is may be null. + */ + const ScopedPointer& operator= (ObjectType* const newObjectToTakePossessionOf) + { + if (object != newObjectToTakePossessionOf) + { + ObjectType* const oldObject = object; + object = newObjectToTakePossessionOf; + delete oldObject; + } + + return *this; + } + + /** Returns the object that this ScopedPointer refers to. + */ + inline operator ObjectType*() const { return object; } + + /** Returns the object that this ScopedPointer refers to. + */ + inline ObjectType& operator*() const { return *object; } + + /** Lets you access methods and properties of the object that this ScopedPointer refers to. */ + inline ObjectType* operator->() const { return object; } + + /** Returns a pointer to the object by casting it to whatever type you need. */ + template + inline operator CastType*() const { return static_cast (object); } + + /** Returns a reference to the address of the object that this ScopedPointer refers to. */ + inline ObjectType** operator&() const { return (ObjectType**) &object; } + + /** Removes the current object from this ScopedPointer without deleting it. + + This will return the current object, and set the ScopedPointer to a null pointer. + */ + ObjectType* release() { ObjectType* const o = object; object = 0; return o; } + + /** Compares the pointer with another pointer. + This can be handy for checking whether this is a null pointer. + */ + inline bool operator== (const ObjectType* const otherPointer) const { return otherPointer == object; } + + /** Compares the pointer with another pointer. + This can be handy for checking whether this is a null pointer. + */ + inline bool operator!= (const ObjectType* const otherPointer) const { return otherPointer != object; } + + /** Swaps this object with that of another ScopedPointer. + The two objects simply exchange their pointers. + */ + void swapWith (ScopedPointer & other) + { + // Two ScopedPointers should never be able to refer to the same object - if + // this happens, you must have done something dodgy! + jassert (object != other.object); + + swapVariables (object, other.object); + } + +private: + + ObjectType* object; +}; + +#endif // __JUCE_SCOPEDPOINTER_JUCEHEADER__ +/********* End of inlined file: juce_ScopedPointer.h *********/ + /** An array designed for holding objects. This holds a list of pointers to objects, and will automatically @@ -5238,7 +5390,7 @@ public: { if (indexToChange >= 0) { - ObjectClass* toDelete = 0; + ScopedPointer toDelete; lock.enter(); if (indexToChange < numUsed) @@ -5260,8 +5412,6 @@ public: } lock.exit(); - - delete toDelete; } } @@ -5352,8 +5502,8 @@ public: void remove (const int indexToRemove, const bool deleteObject = true) { + ScopedPointer toDelete; lock.enter(); - ObjectClass* toDelete = 0; if (((unsigned int) indexToRemove) < (unsigned int) numUsed) { @@ -5373,8 +5523,6 @@ public: } lock.exit(); - - delete toDelete; } /** Removes a specified object from the array. @@ -10018,6 +10166,9 @@ private: #endif #ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ +#endif +#ifndef __JUCE_SCOPEDPOINTER_JUCEHEADER__ + #endif #ifndef __JUCE_SORTEDSET_JUCEHEADER__ @@ -12293,7 +12444,7 @@ public: private: File logFile; CriticalSection logLock; - FileOutputStream* logStream; + ScopedPointer logStream; void trimFileSize (int maxFileSizeBytes) const; @@ -13688,7 +13839,7 @@ private: String wildCard; int index; const int whatToLookFor; - DirectoryIterator* subIterator; + ScopedPointer subIterator; DirectoryIterator (const DirectoryIterator&); const DirectoryIterator& operator= (const DirectoryIterator&); @@ -14197,7 +14348,7 @@ private: friend class ZipInputStream; CriticalSection lock; InputStream* inputStream; - InputSource* inputSource; + ScopedPointer inputSource; bool deleteStreamWhenDestroyed; int numEntries, centralRecStart; @@ -15435,7 +15586,7 @@ private: String lastError, dtdText; StringArray tokenisedDTD; bool needToLoadDTD, ignoreEmptyTextElements; - InputSource* inputSource; + ScopedPointer inputSource; void setLastError (const String& desc, const bool carryOn) throw(); void skipHeader() throw(); @@ -21162,7 +21313,7 @@ public: If a gradient is active, the overall opacity with which it should be applied is indicated by the alpha channel of the colour variable. */ - ColourGradient* gradient; + ScopedPointer gradient; /** Returns the image that should be used for tiling. The FillType object just keeps a pointer to this image, it doesn't own it, so you have to @@ -22667,7 +22818,7 @@ protected: private: Component* lastFocusedComponent; - ComponentDeletionWatcher* dragAndDropTargetComponent; + ScopedPointer dragAndDropTargetComponent; Component* lastDragAndDropCompUnderMouse; bool fakeMouseMessageSent : 1, isWindowMinimised : 1; @@ -26218,7 +26369,7 @@ private: OwnedArray commands; SortedSet listeners; - KeyPressMappingSet* keyMappings; + ScopedPointer keyMappings; ApplicationCommandTarget* firstTarget; void sendListenerInvokeCallback (const ApplicationCommandTarget::InvocationInfo& info) const; @@ -26528,8 +26679,7 @@ public: private: - PropertiesFile* userProps; - PropertiesFile* commonProps; + ScopedPointer userProps, commonProps; String appName, fileSuffix, folderName; int msBeforeSaving, options; @@ -27789,7 +27939,7 @@ private: OwnedArray tracks; Array trackStartSamples; int currentReaderTrack; - AudioFormatReader* reader; + ScopedPointer reader; AudioCDReader (const File& volume); public: static int compareElements (const File* const, const File* const) throw(); @@ -28127,10 +28277,10 @@ public: private: AudioFormatManager& formatManagerToUse; AudioThumbnailCache& cache; - InputSource* source; + ScopedPointer source; CriticalSection readerLock; - AudioFormatReader* reader; + ScopedPointer reader; MemoryBlock data, cachedLevels; int orginalSamplesPerThumbnailSample; @@ -31884,7 +32034,7 @@ private: SortedSet buttonListeners; friend class InternalButtonRepeatTimer; - Timer* repeatTimer; + ScopedPointer repeatTimer; uint32 buttonPressTime, lastTimeCallbackTime; ApplicationCommandManager* commandManagerToUse; int autoRepeatDelay, autoRepeatSpeed, autoRepeatMinimumDelay; @@ -33759,10 +33909,10 @@ private: String text; Font font; Justification justification; - TextEditor* editor; + ScopedPointer editor; SortedSet listeners; Component* ownerComponent; - ComponentDeletionWatcher* deletionWatcher; + ScopedPointer deletionWatcher; int horizontalBorderSize, verticalBorderSize; float minimumHorizontalScale; bool editSingleClick : 1; @@ -34502,17 +34652,17 @@ private: OwnedArray lastDeviceTypeConfigs; AudioDeviceSetup currentSetup; - AudioIODevice* currentAudioDevice; + ScopedPointer currentAudioDevice; SortedSet callbacks; int numInputChansNeeded, numOutputChansNeeded; String currentDeviceType; BitArray inputChannels, outputChannels; - XmlElement* lastExplicitSettings; + ScopedPointer lastExplicitSettings; mutable bool listNeedsScanning; bool useInputNames; int inputLevelMeasurementEnabledCount; double inputLevel; - AudioSampleBuffer* testSound; + ScopedPointer testSound; int testSoundPosition; AudioSampleBuffer tempBuffer; @@ -34521,7 +34671,7 @@ private: Array midiCallbacks; Array midiCallbackDevices; String defaultMidiOutputName; - MidiOutput* defaultMidiOutput; + ScopedPointer defaultMidiOutput; CriticalSection audioCallbackLock, midiCallbackLock; double cpuUsageMs, timeToCpuScale; @@ -35066,8 +35216,8 @@ public: const MidiMessageSequence::MidiEventHolder* const second) throw(); private: - MidiMessageSequence* tracks [128]; - short numTracks, timeFormat; + OwnedArray tracks; + short timeFormat; MidiFile (const MidiFile&); const MidiFile& operator= (const MidiFile&); @@ -38914,7 +39064,7 @@ private: friend class SamplerVoice; String name; - AudioSampleBuffer* data; + ScopedPointer data; double sourceSampleRate; BitArray midiNotes; int length, attackSamples, releaseSamples; @@ -39321,8 +39471,8 @@ public: private: CriticalSection pipeAndSocketLock; - StreamingSocket* socket; - NamedPipe* pipe; + ScopedPointer socket; + ScopedPointer pipe; bool callbackConnectionState; const bool useMessageThread; const uint32 magicMessageHeader; @@ -39412,7 +39562,7 @@ public: juce_UseDebuggingNewOperator private: - StreamingSocket* volatile socket; + ScopedPointer socket; void run(); @@ -39568,8 +39718,8 @@ private: friend class CallbackMessage; static MessageManager* instance; - SortedSet messageListeners; - ActionListenerList* broadcastListeners; + SortedSet messageListeners; + ScopedPointer broadcastListeners; friend class JUCEApplication; bool quitMessagePosted, quitMessageReceived; @@ -40228,14 +40378,8 @@ protected: private: ButtonStyle style; - Drawable* normalImage; - Drawable* overImage; - Drawable* downImage; - Drawable* disabledImage; - Drawable* normalImageOn; - Drawable* overImageOn; - Drawable* downImageOn; - Drawable* disabledImageOn; + ScopedPointer normalImage, overImage, downImage, disabledImage; + ScopedPointer normalImageOn, overImageOn, downImageOn, disabledImageOn; Colour backgroundOff, backgroundOn; int edgeIndent; @@ -40915,7 +41059,7 @@ protected: private: friend class DragImageComponent; - Component* dragImageComponent; + ScopedPointer dragImageComponent; String currentDragDesc; }; @@ -41470,7 +41614,7 @@ private: const int itemId; ToolbarEditingMode mode; Toolbar::ToolbarItemStyle toolbarStyle; - Component* overlayComp; + ScopedPointer overlayComp; int dragOffsetX, dragOffsetY; bool isActive, isBeingDragged, isBeingUsedAsAButton; Rectangle contentArea; @@ -41531,8 +41675,7 @@ public: juce_UseDebuggingNewOperator private: - Drawable* const normalImage; - Drawable* const toggledOnImage; + ScopedPointer normalImage, toggledOnImage; ToolbarButton (const ToolbarButton&); const ToolbarButton& operator= (const ToolbarButton&); @@ -43108,7 +43251,7 @@ private: Label* valueBox; Button* incButton; Button* decButton; - Component* popupDisplay; + ScopedPointer popupDisplay; Component* parentForPopupDisplay; float getLinearSliderPos (const double value); @@ -43508,7 +43651,7 @@ private: OwnedArray columns; Array listeners; - Component* dragOverlayComp; + ScopedPointer dragOverlayComp; bool columnsChanged, columnsResized, sortChanged, menuActive, stretchToFit; int columnIdBeingResized, columnIdBeingDragged, initialColumnWidth; @@ -45619,7 +45762,7 @@ protected: private: - DirectoryContentsList* fileList; + ScopedPointer fileList; const FileFilter* fileFilter; int flags; @@ -46036,7 +46179,7 @@ protected: private: friend class TopLevelWindowManager; bool useDropShadow, useNativeTitleBar, windowIsActive_; - DropShadower* shadower; + ScopedPointer shadower; void setWindowActive (const bool isNowActive) throw(); @@ -46740,11 +46883,11 @@ protected: #endif - ResizableCornerComponent* resizableCorner; - ResizableBorderComponent* resizableBorder; + ScopedPointer resizableCorner; + ScopedPointer resizableBorder; private: - Component* contentComponent; + ScopedPointer contentComponent; bool resizeToFitContent, fullscreen; ComponentDragger dragger; Rectangle lastNonFullScreenPos; @@ -47635,7 +47778,7 @@ public: private: File fileToLoad; - Image* currentThumbnail; + ScopedPointer currentThumbnail; String currentDetails; void getThumbSize (int& w, int& h) const; @@ -48138,7 +48281,7 @@ private: bool reentrant; int lastX, lastY, lastWidth, lastHeight; #ifdef JUCE_DEBUG - ComponentDeletionWatcher* deletionWatcher; + ScopedPointer deletionWatcher; #endif void unregister() throw(); @@ -48936,7 +49079,7 @@ private: int itemUnderMouse, currentPopupIndex, topLevelIndexClicked, indexToShowAgain; int lastMouseX, lastMouseY; bool inModalState; - Component* currentPopup; + ScopedPointer currentPopup; int getItemAt (int x, int y); void updateItemUnderMouse (const int x, const int y); @@ -49160,9 +49303,9 @@ public: private: int titleBarHeight, menuBarHeight, requiredButtons; bool positionTitleBarButtonsOnLeft, drawTitleTextCentred; - Button* titleBarButtons [3]; - Image* titleBarIcon; - MenuBarComponent* menuBar; + ScopedPointer