diff --git a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.mm b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.mm index 7b30914a7d..a77c7e1aca 100644 --- a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.mm +++ b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.mm @@ -191,7 +191,9 @@ void detachComponentFromWindowRef (Component* comp, void* nsWindow) HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) comp->getComponentProperty ("dummyViewRef", false, String::empty).getHexValue64(); - CFRelease (dummyView); + + if (HIViewIsValid (dummyView)) + CFRelease (dummyView); NSWindow* hostWindow = (NSWindow*) nsWindow; NSView* pluginView = (NSView*) comp->getWindowHandle(); diff --git a/extras/juce demo/src/demos/FontsAndTextDemo.cpp b/extras/juce demo/src/demos/FontsAndTextDemo.cpp index 43fad8b879..f34c030734 100644 --- a/extras/juce demo/src/demos/FontsAndTextDemo.cpp +++ b/extras/juce demo/src/demos/FontsAndTextDemo.cpp @@ -63,7 +63,7 @@ public: textBox->setMultiLine (true, true); textBox->setReturnKeyStartsNewLine (true); - textBox->setText (T("The Quick Brown Fox Jumped Over The Lazy Dog\n\nAa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz 0123456789")); + textBox->setText (T("The Quick Brown Fox Jumps Over The Lazy Dog\n\nAa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz 0123456789")); addAndMakeVisible (boldButton = new ToggleButton (T("bold"))); boldButton->addButtonListener (this); diff --git a/src/native/windows/juce_win32_SystemStats.cpp b/src/native/windows/juce_win32_SystemStats.cpp index 10b4927635..6e249aa97e 100644 --- a/src/native/windows/juce_win32_SystemStats.cpp +++ b/src/native/windows/juce_win32_SystemStats.cpp @@ -254,21 +254,14 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() { switch (info.dwMajorVersion) { - case 5: - return (info.dwMinorVersion == 0) ? Win2000 : WinXP; - - case 6: - return (info.dwMinorVersion == 0) ? WinVista : Windows7; - - default: - jassertfalse // !! not a supported OS! - break; + case 5: return (info.dwMinorVersion == 0) ? Win2000 : WinXP; + case 6: return (info.dwMinorVersion == 0) ? WinVista : Windows7; + default: jassertfalse; break; // !! not a supported OS! } } else if (info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { jassert (info.dwMinorVersion != 0); // !! still running on Windows 95?? - return Win98; } @@ -281,25 +274,12 @@ const String SystemStats::getOperatingSystemName() throw() switch (getOperatingSystemType()) { - case WinVista: - name = "Windows Vista"; - break; - - case WinXP: - name = "Windows XP"; - break; - - case Win2000: - name = "Windows 2000"; - break; - - case Win98: - name = "Windows 98"; - break; - - default: - jassertfalse // !! new type of OS? - break; + case Windows7: name = "Windows 7"; break; + case WinVista: name = "Windows Vista"; break; + case WinXP: name = "Windows XP"; break; + case Win2000: name = "Windows 2000"; break; + case Win98: name = "Windows 98"; break; + default: jassertfalse; break; // !! new type of OS? } return name; @@ -310,7 +290,7 @@ bool SystemStats::isOperatingSystem64Bit() throw() #ifdef _WIN64 return true; #else - typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); + typedef BOOL (WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandle (L"kernel32"), "IsWow64Process"); @@ -326,9 +306,10 @@ bool SystemStats::isOperatingSystem64Bit() throw() //============================================================================== int SystemStats::getMemorySizeInMegabytes() throw() { - MEMORYSTATUS mem; - GlobalMemoryStatus (&mem); - return (int) (mem.dwTotalPhys / (1024 * 1024)) + 1; + MEMORYSTATUSEX mem; + mem.dwLength = sizeof (mem); + GlobalMemoryStatusEx (&mem); + return (int) (mem.ullTotalPhys / (1024 * 1024)) + 1; } int SystemStats::getNumCpus() throw()