Browse Source

Added some safety-checking to stop people accidentally passing a ScopedPointer to an OptionalScopedPointer

tags/2021-05-28
jules 10 years ago
parent
commit
0294e772dd
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      modules/juce_core/memory/juce_OptionalScopedPointer.h

+ 6
- 0
modules/juce_core/memory/juce_OptionalScopedPointer.h View File

@@ -180,6 +180,12 @@ private:
//==============================================================================
ScopedPointer<ObjectType> object;
bool shouldDelete;
// This is here to avoid people accidentally taking a second owned copy of
// a scoped pointer, which is almost certainly not what you intended to do!
// If you hit a problem with this, you probably meant to say
// myPointer.setOwned (myScopedPointer.release())
void setOwned (const ScopedPointer<ObjectType>&) JUCE_DELETED_FUNCTION;
};


Loading…
Cancel
Save