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

Made a lot of ScopedPointer usage conform to the std::unique_ptr interface

This commit is contained in:
Tom Poole 2018-04-10 14:50:25 +01:00
parent 2d9fc46b4e
commit 4229dc0a4f
99 changed files with 6809 additions and 498 deletions

View file

@ -94,10 +94,10 @@ CameraDevice* CameraDevice::openDevice (int index,
int maxWidth, int maxHeight,
bool useHighQuality)
{
if (ScopedPointer<CameraDevice> d = new CameraDevice (getAvailableDevices() [index], index,
minWidth, minHeight, maxWidth, maxHeight, useHighQuality))
if (d->pimpl->openedOk())
return d.release();
ScopedPointer<CameraDevice> d (new CameraDevice (getAvailableDevices() [index], index,
minWidth, minHeight, maxWidth, maxHeight, useHighQuality));
if (d != nullptr && d->pimpl->openedOk())
return d.release();
return nullptr;
}