Browse Source

Couple of small fixes for mac midi and win32 threads, and fixed a memory leak in the demo app.

tags/2021-05-28
Julian Storer 16 years ago
parent
commit
a8a602f7a2
4 changed files with 13 additions and 12 deletions
  1. +2
    -1
      extras/juce demo/src/demos/RenderingTestComponent.cpp
  2. +7
    -7
      juce_amalgamated.cpp
  3. +3
    -3
      src/native/mac/juce_mac_CoreMidi.cpp
  4. +1
    -1
      src/native/windows/juce_win32_Threads.cpp

+ 2
- 1
extras/juce demo/src/demos/RenderingTestComponent.cpp View File

@@ -35,6 +35,7 @@ public:
{
setOpaque (true);
averageTime = 0;
svgDrawable = 0;
rgbImage = ImageFileFormat::loadFrom (RenderingTestComponent::demoJpeg_jpg, RenderingTestComponent::demoJpeg_jpgSize);
argbImage = ImageFileFormat::loadFrom (RenderingTestComponent::demoPng_png, RenderingTestComponent::demoPng_pngSize);
@@ -334,7 +335,7 @@ private:
void createSVGDrawable()
{
svgDrawable = 0;
deleteAndZero (svgDrawable);
MemoryInputStream iconsFileStream (BinaryData::icons_zip, BinaryData::icons_zipSize, false);
ZipFile icons (&iconsFileStream, false);


+ 7
- 7
juce_amalgamated.cpp View File

@@ -234198,7 +234198,7 @@ bool InterProcessLock::enter (const int timeOutMillisecs) throw()
{
if (reentrancyLevel++ == 0)
{
internal = CreateMutex (0, TRUE, name);
internal = CreateMutex (0, TRUE, "Global\\" + name);

if (internal != 0 && GetLastError() == ERROR_ALREADY_EXISTS)
{
@@ -264828,8 +264828,8 @@ static bool makeSureClientExists()
class MidiPortAndEndpoint
{
public:
MidiPortAndEndpoint (MIDIPortRef port, MIDIEndpointRef endpoint) throw()
: port (port), endPoint (endpoint)
MidiPortAndEndpoint (MIDIPortRef port_, MIDIEndpointRef endPoint_) throw()
: port (port_), endPoint (endPoint_)
{
}

@@ -264838,7 +264838,7 @@ public:
if (port != 0)
MIDIPortDispose (port);

if (endPoint != 0)
if (port == 0 && endPoint != 0) // if port == 0, it means we created the endpoint, so it's safe to delete it
MIDIEndpointDispose (endPoint);
}

@@ -272540,8 +272540,8 @@ static bool makeSureClientExists()
class MidiPortAndEndpoint
{
public:
MidiPortAndEndpoint (MIDIPortRef port, MIDIEndpointRef endpoint) throw()
: port (port), endPoint (endpoint)
MidiPortAndEndpoint (MIDIPortRef port_, MIDIEndpointRef endPoint_) throw()
: port (port_), endPoint (endPoint_)
{
}

@@ -272550,7 +272550,7 @@ public:
if (port != 0)
MIDIPortDispose (port);

if (endPoint != 0)
if (port == 0 && endPoint != 0) // if port == 0, it means we created the endpoint, so it's safe to delete it
MIDIEndpointDispose (endPoint);
}



+ 3
- 3
src/native/mac/juce_mac_CoreMidi.cpp View File

@@ -236,8 +236,8 @@ static bool makeSureClientExists()
class MidiPortAndEndpoint
{
public:
MidiPortAndEndpoint (MIDIPortRef port, MIDIEndpointRef endpoint) throw()
: port (port), endPoint (endpoint)
MidiPortAndEndpoint (MIDIPortRef port_, MIDIEndpointRef endPoint_) throw()
: port (port_), endPoint (endPoint_)
{
}
@@ -246,7 +246,7 @@ public:
if (port != 0)
MIDIPortDispose (port);
if (endPoint != 0)
if (port == 0 && endPoint != 0) // if port == 0, it means we created the endpoint, so it's safe to delete it
MIDIEndpointDispose (endPoint);
}


+ 1
- 1
src/native/windows/juce_win32_Threads.cpp View File

@@ -357,7 +357,7 @@ bool InterProcessLock::enter (const int timeOutMillisecs) throw()
{
if (reentrancyLevel++ == 0)
{
internal = CreateMutex (0, TRUE, name);
internal = CreateMutex (0, TRUE, "Global\\" + name);
if (internal != 0 && GetLastError() == ERROR_ALREADY_EXISTS)
{


Loading…
Cancel
Save