1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

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.

This commit is contained in:
Julian Storer 2010-01-02 23:01:18 +00:00
parent 4ed1d791e5
commit c22c06c80c
126 changed files with 1454 additions and 1838 deletions

View file

@ -107,7 +107,7 @@ bool FileChooser::showDialog (const bool selectsDirectories,
const bool selectMultipleFiles,
FilePreviewComponent* const previewComponent)
{
ComponentDeletionWatcher* currentlyFocusedChecker = 0;
ScopedPointer <ComponentDeletionWatcher> currentlyFocusedChecker;
Component* const currentlyFocused = Component::getCurrentlyFocusedComponent();
if (currentlyFocused != 0)
@ -168,8 +168,6 @@ bool FileChooser::showDialog (const bool selectsDirectories,
if (currentlyFocused != 0 && ! currentlyFocusedChecker->hasBeenDeleted())
currentlyFocused->grabKeyboardFocus();
delete currentlyFocusedChecker;
return results.size() > 0;
}