1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

More std::unique_ptr modernisation - changed functions that used to return raw Drawable* pointers to use it

This commit is contained in:
jules 2019-05-16 15:37:40 +01:00
parent a2017062f5
commit a97c4a9139
28 changed files with 118 additions and 116 deletions

View file

@ -40,7 +40,7 @@ DrawableComposite::DrawableComposite (const DrawableComposite& other)
{
for (auto* c : other.getChildren())
if (auto* d = dynamic_cast<const Drawable*> (c))
addAndMakeVisible (d->createCopy());
addAndMakeVisible (d->createCopy().release());
}
DrawableComposite::~DrawableComposite()
@ -48,9 +48,9 @@ DrawableComposite::~DrawableComposite()
deleteAllChildren();
}
Drawable* DrawableComposite::createCopy() const
std::unique_ptr<Drawable> DrawableComposite::createCopy() const
{
return new DrawableComposite (*this);
return std::make_unique<DrawableComposite> (*this);
}
//==============================================================================