mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Smart Pointers: Add a new enum for indicating if a smart point should increment a reference count or not
This commit is contained in:
parent
8931d45fe9
commit
e68627c9ed
68 changed files with 243 additions and 160 deletions
|
|
@ -122,7 +122,7 @@ class AccessibilityHandler::AccessibilityNativeImpl
|
|||
{
|
||||
public:
|
||||
explicit AccessibilityNativeImpl (AccessibilityHandler& owner)
|
||||
: accessibilityElement (becomeComSmartPtrOwner (new AccessibilityNativeHandle (owner)))
|
||||
: accessibilityElement (new AccessibilityNativeHandle (owner), IncrementRef::no)
|
||||
{
|
||||
++providerCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class UIAProviderBase
|
|||
{
|
||||
public:
|
||||
explicit UIAProviderBase (AccessibilityNativeHandle* nativeHandleIn)
|
||||
: nativeHandle (addComSmartPtrOwner (nativeHandleIn))
|
||||
: nativeHandle (nativeHandleIn, IncrementRef::yes)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ private:
|
|||
public:
|
||||
UIATextRangeProvider (UIATextProvider& textProvider, Range<int> range)
|
||||
: UIAProviderBase (textProvider.getHandler().getNativeImplementation()),
|
||||
owner (addComSmartPtrOwner (&textProvider)),
|
||||
owner (&textProvider, IncrementRef::yes),
|
||||
selectionRange (range)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,8 +357,8 @@ public:
|
|||
|
||||
static jobjectArray JNICALL contentSharerGetStreamTypes (JNIEnv*, jobject /*contentProvider*/, jobject uri, jstring mimeTypeFilter)
|
||||
{
|
||||
return getInstance().getStreamTypes (addLocalRefOwner (uri),
|
||||
addLocalRefOwner (mimeTypeFilter));
|
||||
return getInstance().getStreamTypes (LocalRef (uri, IncrementRef::yes),
|
||||
LocalRef (mimeTypeFilter, IncrementRef::yes));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ private:
|
|||
{
|
||||
HWND hwnd = nullptr;
|
||||
|
||||
if (auto window = addComSmartPtrOwner (d).getInterface<IOleWindow>())
|
||||
if (auto window = ComSmartPtr (d, IncrementRef::yes).getInterface<IOleWindow>())
|
||||
window->GetWindow (&hwnd);
|
||||
|
||||
ScopedLock lock (owner.deletingDialog);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue