1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Windows: Fix DLL build

There were a few "ambiguous operator new/delete" errors that were due to
inheriting from a private base class that used the leak detector. These
errors are resolved by adding the leak detector to the derived classes.

JUCE_API was missing from a few useful types, notably the ARA hosting
types.
This commit is contained in:
reuk 2024-10-22 13:24:43 +01:00
parent 6f20de5434
commit 90f37e27ea
14 changed files with 28 additions and 17 deletions

View file

@ -45,6 +45,8 @@ template <typename Type>
class AudioBuffer
{
public:
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4661)
//==============================================================================
/** Creates an empty buffer with 0 channels and 0 length. */
AudioBuffer() noexcept

View file

@ -63,7 +63,7 @@ class ScopedNoDenormals;
@tags{Audio}
*/
template <typename FloatType, typename CountType>
struct FloatVectorOperationsBase
struct JUCE_API FloatVectorOperationsBase
{
/** Clears a vector of floating point numbers. */
static void JUCE_CALLTYPE clear (FloatType* dest, CountType numValues) noexcept;

View file

@ -728,6 +728,8 @@ private:
CriticalSection activeCollectorLock;
ReferenceCountedArray<MidiInCollector> activeCollectors;
Array<MidiOutHandle*> activeOutputHandles;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Win32MidiService)
};
Array<Win32MidiService::MidiInCollector*, CriticalSection> Win32MidiService::MidiInCollector::activeMidiCollectors;

View file

@ -65,7 +65,7 @@ namespace juce
@tags{ARA}
*/
class ARAEditGuard
class JUCE_API ARAEditGuard
{
public:
explicit ARAEditGuard (ARA::Host::DocumentController& dcIn);
@ -167,7 +167,7 @@ private:
@tags{ARA}
*/
class AudioSource : public ManagedARAHandle<AudioSource, ARA::ARAAudioSourceRef>
class JUCE_API AudioSource : public ManagedARAHandle<AudioSource, ARA::ARAAudioSourceRef>
{
public:
/** Returns an %ARA versioned struct with the `structSize` correctly set for the currently
@ -235,7 +235,7 @@ public:
@tags{ARA}
*/
class AudioModification : public ManagedARAHandle<AudioModification, ARA::ARAAudioModificationRef>
class JUCE_API AudioModification : public ManagedARAHandle<AudioModification, ARA::ARAAudioModificationRef>
{
public:
/** Returns an %ARA versioned struct with the `structSize` correctly set for the currently
@ -293,7 +293,7 @@ private:
@tags{ARA}
*/
struct DeletionListener
struct JUCE_API DeletionListener
{
/** Destructor. */
virtual ~DeletionListener() = default;
@ -318,7 +318,7 @@ struct DeletionListener
@tags{ARA}
*/
struct PlaybackRegion
struct JUCE_API PlaybackRegion
{
public:
/** Returns an %ARA versioned struct with the `structSize` correctly set for the currently
@ -386,7 +386,7 @@ private:
@tags{ARA}
*/
class MusicalContext : public ManagedARAHandle<MusicalContext, ARA::ARAMusicalContextRef>
class JUCE_API MusicalContext : public ManagedARAHandle<MusicalContext, ARA::ARAMusicalContextRef>
{
public:
/** Returns an %ARA versioned struct with the `structSize` correctly set for the currently
@ -448,7 +448,7 @@ public:
@tags{ARA}
*/
class RegionSequence : public ManagedARAHandle<RegionSequence, ARA::ARARegionSequenceRef>
class JUCE_API RegionSequence : public ManagedARAHandle<RegionSequence, ARA::ARARegionSequenceRef>
{
public:
/** Returns an %ARA versioned struct with the `structSize` correctly set for the currently
@ -669,7 +669,7 @@ using EditorRendererInterface = PlaybackRegionRegistry<ARA::ARAEditorRendererR
@tags{ARA}
*/
class PlugInExtensionInstance final
class JUCE_API PlugInExtensionInstance final
{
public:
/** Creates an empty PlugInExtensionInstance object.
@ -726,7 +726,7 @@ private:
@tags{ARA}
*/
class ARAHostDocumentController final
class JUCE_API ARAHostDocumentController final
{
public:
/** Factory function.
@ -775,7 +775,7 @@ private:
The object passed to the callback must be checked even if the plugin instance reports having
ARA extensions.
*/
void createARAFactoryAsync (AudioPluginInstance& instance, std::function<void (ARAFactoryWrapper)> cb);
void JUCE_API createARAFactoryAsync (AudioPluginInstance& instance, std::function<void (ARAFactoryWrapper)> cb);
} // namespace juce

View file

@ -429,7 +429,7 @@ struct LambdaInvoker final : private Timer,
std::function<void()> function;
JUCE_DECLARE_NON_COPYABLE (LambdaInvoker)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LambdaInvoker)
};
void JUCE_CALLTYPE Timer::callAfterDelay (int milliseconds, std::function<void()> f)

View file

@ -53,6 +53,8 @@ private:
thread.join();
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SwapChainThread)
private:
Direct2DHwndContext::HwndPimpl& owner;
HANDLE swapChainEventHandle = nullptr;

View file

@ -84,7 +84,7 @@ private:
bool shouldBeShown() const;
void timerCallback() override;
JUCE_DECLARE_NON_COPYABLE (CaretComponent)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CaretComponent)
};
} // namespace juce

View file

@ -177,6 +177,7 @@ private:
std::map<void*, std::function<void()>> listeners;
JUCE_DECLARE_WEAK_REFERENCEABLE (VirtualDesktopWatcher)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VirtualDesktopWatcher)
};
class DropShadower::ParentVisibilityChangedListener final : public ComponentListener

View file

@ -404,7 +404,7 @@ private:
&& sourceToCheck.getIndex() == originalInputSourceIndex);
}
JUCE_DECLARE_NON_COPYABLE (DragImageComponent)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DragImageComponent)
};

View file

@ -883,7 +883,7 @@ private:
return createIgnoredAccessibilityHandler (*this);
}
JUCE_DECLARE_NON_COPYABLE (TextHolderComponent)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextHolderComponent)
};
//==============================================================================

View file

@ -83,7 +83,7 @@ public:
std::unique_ptr<Component> content;
CallOutBox callout;
JUCE_DECLARE_NON_COPYABLE (CallOutBoxCallback)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CallOutBoxCallback)
};
CallOutBox& CallOutBox::launchAsynchronously (std::unique_ptr<Component> content, Rectangle<int> area, Component* parent)

View file

@ -50,7 +50,7 @@ class WebBrowserComponent;
types using the WebBrowserComponent::Options::withOptionsFrom function as they have to be
constructed before the WebBrowserComponent.
*/
class WebViewLifetimeListener
class JUCE_API WebViewLifetimeListener
{
public:
virtual ~WebViewLifetimeListener() = default;

View file

@ -1224,6 +1224,8 @@ private:
if (auto* cachedImage = CachedImage::get (*getComponent()))
cachedImage->checkViewportBounds();
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Attachment)
};
//==============================================================================

View file

@ -45,6 +45,8 @@ struct Spinner final : public Component,
{
getLookAndFeel().drawSpinningWaitAnimation (g, Colours::darkgrey, 0, 0, getWidth(), getHeight());
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Spinner)
};
struct OnlineUnlockForm::OverlayComp final : public Component,