Skip to content

Commit

Permalink
VST: Remove leftover macOS code
Browse files Browse the repository at this point in the history
- Remove ResourceHandle remnants
- Replace use of BundleHandle with CFBundleRef

For the last point, if I'm not mistakened, macOS will automatically
unload the bundle for us, and it's actually discouraged that we perform
any manual unloading ourselves according to the documentation. I'll go
ahead and trust the macOS documentation for now.

Signed-off-by: Avery King <[email protected]>
  • Loading branch information
generic-pers0n committed Sep 19, 2024
1 parent 7f2a354 commit e714994
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/effects/VST/VSTEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,22 +1108,6 @@ void VSTEffect::ModuleDeleter::operator() (void* p) const
}
#endif

#if defined(__WXMAC__)
void VSTEffect::BundleDeleter::operator() (void* p) const
{
if (p)
CFRelease(static_cast<CFBundleRef>(p));
}

void VSTEffect::ResourceHandle::reset()
{
if (mpHandle)
CFBundleCloseBundleResourceMap(mpHandle, mNum);
mpHandle = nullptr;
mNum = 0;
}
#endif

VSTEffect::VSTEffect(const PluginPath & path, VSTEffect *master)
: mPath(path),
mMaster(master)
Expand Down Expand Up @@ -2000,7 +1984,7 @@ bool VSTEffect::Load()
}

// Create the bundle using the URL
BundleHandle bundleRef{ CFBundleCreate(kCFAllocatorDefault, urlRef) };
CFBundleRef bundleRef = CFBundleCreate(kCFAllocatorDefault, urlRef);

// Done with the URL
CFRelease(urlRef);
Expand All @@ -2012,7 +1996,7 @@ bool VSTEffect::Load()
}

// Retrieve a reference to the executable
CFURLRef exeRef = CFBundleCopyExecutableURL(bundleRef.get());
CFURLRef exeRef = CFBundleCopyExecutableURL(bundleRef);
if (!exeRef)
return false;

Expand Down

0 comments on commit e714994

Please sign in to comment.