mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Tidied up some spelling and comments
This commit is contained in:
parent
e00d990737
commit
bc027b5237
2 changed files with 12 additions and 13 deletions
|
|
@ -2560,12 +2560,13 @@ private:
|
|||
bypassParam = param;
|
||||
|
||||
std::function<AudioProcessorParameterGroup*(Vst::UnitID)> findOrCreateGroup;
|
||||
|
||||
findOrCreateGroup = [&groupMap, &infoMap, &findOrCreateGroup](Vst::UnitID groupID)
|
||||
{
|
||||
auto existingGoup = groupMap.find (groupID);
|
||||
auto existingGroup = groupMap.find (groupID);
|
||||
|
||||
if (existingGoup != groupMap.end())
|
||||
return existingGoup->second;
|
||||
if (existingGroup != groupMap.end())
|
||||
return existingGroup->second;
|
||||
|
||||
auto groupInfo = infoMap.find (groupID);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,18 +32,16 @@ namespace juce
|
|||
It must embed a WeakReference::Master object, which stores a shared pointer object, and must clear
|
||||
this master pointer in its destructor.
|
||||
|
||||
Note that WeakReference is not designed to be thread-safe, so if you're accessing it from
|
||||
different threads, you'll need to do your own locking around all uses of the pointer and
|
||||
the object it refers to.
|
||||
|
||||
E.g.
|
||||
@code
|
||||
class MyObject
|
||||
{
|
||||
public:
|
||||
MyObject()
|
||||
{
|
||||
// If you're planning on using your WeakReferences in a multi-threaded situation, you may choose
|
||||
// to create a WeakReference to the object here in the constructor, which will pre-initialise the
|
||||
// embedded object, avoiding an (extremely unlikely) race condition that could occur if multiple
|
||||
// threads overlap while creating the first WeakReference to it.
|
||||
}
|
||||
MyObject() {}
|
||||
|
||||
~MyObject()
|
||||
{
|
||||
|
|
@ -63,12 +61,12 @@ namespace juce
|
|||
|
||||
// Here's an example of using a pointer..
|
||||
|
||||
MyObject* n = new MyObject();
|
||||
auto* n = new MyObject();
|
||||
WeakReference<MyObject> myObjectRef = n;
|
||||
|
||||
MyObject* pointer1 = myObjectRef; // returns a valid pointer to 'n'
|
||||
auto pointer1 = myObjectRef.get(); // returns a valid pointer to 'n'
|
||||
delete n;
|
||||
MyObject* pointer2 = myObjectRef; // returns a null pointer
|
||||
auto pointer2 = myObjectRef.get(); // now returns nullptr
|
||||
@endcode
|
||||
|
||||
@see WeakReference::Master
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue