VST Plugin(mac) gui being painted white

Hi coleagues,
Any progress about this issue?
yesterday, I have compiled (and linked!) a very matured plugin in PC VS2010 and at first glance, it seems to have the same behaviour: the Plugin GUI appears fow a while and suddenly a white sheet covers the whole client area.

OSX 10.7.3
Juce 1.53
XCode 4.3

Gabriel

Edit: Same thing happens with a fresh compiled JuceDemoPlugin. !??!

Definitely, it is plug-in Host’s blame. I m working with the source forge release. I’ll try the latest master GIT one and I’ll report you.

This problem does continue. My VST development works flawlessly on Nuendo 4 (VST) but I cannot see it in PluginHost app due to the ‘white blanket effect’ :wink:

Please take a look!

I’ve checked in a fix for this now - let me know if it helps.

It was a plugin host issue, not a client one. Not sure why it started happening, I think something must have changed in the latest OSX version that changed the window behaviour slightly. (My fix is a bit of a hack, but then anything involving Carbon support isn’t going to be perfect).

Thanks Jules, I can now see the plugin window. Unfortunately on the mac, if I don’t manually close my own juce-created plugin gui’s before shutdown I’m seeing some crashes on shutdown. If I close the juce-created plugin gui’s first then all is well. The funny thing is I already had a method I added to PluginWindow.cpp to close all open windows (which wasn’t being used anymore), but I tried calling it in app shutdown() and it did close all the windows but the system was still irritated on shutdown. I have to manually click their close buttons first. (Sideline, nice fix for VST string encode btw) - I rue the day you ever look inside my source code. If this software ever makes any money in sales you can expect a call asking for consulting advice in cleaning up the ugly pieces I’ve managed to create!

It seems to become irritated here:

ScopedAutoReleasePool::~ScopedAutoReleasePool() { [((NSAutoreleasePool*) pool) release]; }

Here’s the crash report

Process:         StageManager [53436]
Path:            /Applications/StageManager.app/Contents/MacOS/StageManager
Identifier:      com.nsg.StageManager
Version:         2.0.0 (2.0.0)
Code Type:       X86 (Native)
Parent Process:  launchd [118]

Date/Time:       2012-04-17 13:36:37.537 -1000
OS Version:      Mac OS X 10.7.3 (11D50d)
Report Version:  9

Interval Since Last Report:          142842 sec
Crashes Since Last Report:           4
Per-App Interval Since Last Report:  21270 sec
Per-App Crashes Since Last Report:   4
Anonymous UUID:                      F7C2185A-618C-4BFF-AD8D-4C2BAA79BED9

Crashed Thread:  0  Juce Message Thread  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000000e2d9798

VM Regions Near 0xe2d9798:
    MALLOC_LARGE           000000000cf1d000-000000000d094000 [ 1500K] rw-/rwx SM=PRV  
--> 
    CG backing stores      000000000e66b000-000000000e761000 [  984K] rw-/rw- SM=SHM  

Application Specific Information:
objc_msgSend() selector name: retain
objc[53436]: garbage collection is OFF

Thread 0 Crashed:: Juce Message Thread  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x95727d47 objc_msgSend + 23
1   com.apple.AppKit              	0x963fa99e -[NSWindow dealloc] + 884
2   com.apple.AppKit              	0x961ef8eb -[NSWindow release] + 569
3   libobjc.A.dylib               	0x9572ac58 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 404
4   com.apple.CoreFoundation      	0x93a320a5 _CFAutoreleasePoolPop + 53
5   com.apple.Foundation          	0x9a300a63 -[NSAutoreleasePool release] + 131
6   com.nsg.StageManager          	0x000e3c1b 0x1000 + 928795
7   ???                           	0x00679230 0 + 6787632
8   com.nsg.StageManager          	0x001e55f5 0x1000 + 1983989
9   com.nsg.StageManager          	0x00002fb5 0x1000 + 8117

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib        	0x9bb8f90a kevent + 10
1   libdispatch.dylib             	0x960bec58 _dispatch_mgr_invoke + 969
2   libdispatch.dylib             	0x960bd6a7 _dispatch_mgr_thread + 53

Thread 2:
0   libsystem_kernel.dylib        	0x9bb8f02e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x99ef1ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x99ef36fe start_wqthread + 30

Thread 3:
0   libsystem_kernel.dylib        	0x9bb8cc22 mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x9bb8c1f6 mach_msg + 70
2   com.apple.audio.midi.CoreMIDI 	0x004d0fcb XServerMachPort::ReceiveMessage(int&, void*, int&) + 101
3   com.apple.audio.midi.CoreMIDI 	0x004f3f8b MIDIProcess::RunMIDIInThread() + 259
4   com.apple.audio.midi.CoreMIDI 	0x004f4912 MIDIProcess::MIDIInPortThread::Run() + 24
5   com.apple.audio.midi.CoreMIDI 	0x004d259f XThread::RunHelper(void*) + 17
6   com.apple.audio.midi.CoreMIDI 	0x004d1f69 CAPThread::Entry(CAPThread*) + 123
7   libsystem_c.dylib             	0x99eefed9 _pthread_start + 335
8   libsystem_c.dylib             	0x99ef36de thread_start + 34

Thread 4:
0   libsystem_kernel.dylib        	0x9bb8f02e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x99ef1ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x99ef36fe start_wqthread + 30

Thread 5:: com.apple.CFSocket.private
0   libsystem_kernel.dylib        	0x9bb8eb42 __select + 10
1   com.apple.CoreFoundation      	0x93a87ee5 __CFSocketManager + 1557
2   libsystem_c.dylib             	0x99eefed9 _pthread_start + 335
3   libsystem_c.dylib             	0x99ef36de thread_start + 34

Thread 6:
0   libsystem_kernel.dylib        	0x9bb8f02e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x99ef1ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x99ef36fe start_wqthread + 30

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x01134e30  ebx: 0x01134e30  ecx: 0x96afb12c  edx: 0x0e2d9778
  edi: 0x00000000  esi: 0x963fa638  ebp: 0xbffff918  esp: 0xbffff8b8
   ss: 0x00000023  efl: 0x00010206  eip: 0x95727d47   cs: 0x0000001b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000000   gs: 0x0000000f
  cr2: 0x0e2d9798
Logical CPU: 3

There are lots of things that can go wrong when hosts shut down without giving plugins time to clear up - the answer is just to make your host close the plugin GUIs first, and then quit. Most hosts will do that.

If I forgot to do that in the plugin host demo, then I guess I should tweak it - but please remember that the project is called the “plugin host DEMO”. It was only ever intended as a quick-and-dirty example to show people how to get started, not to act as some kind of reference implementation that you should expect to be perfect.

Grinning, and got point - but nooo…demo’s of libraries ARE the reference implementations to us simple-minded users!
I would point out that the pre-whiteout version doesn’t do this, but the whiteout fix version does…
How might I go about dealing with this. As it is now the mac version pops up a ‘crash’ report on shutdown, I really need to get a workaround for that one - any thoughts how I might go about that?

I did try closing all the plugin gui’s programatically and followed that with a one second delay, at the end of app shutdown() but that didn’t seem to help. Closing them manually first works however…Dunno why yet.

Let me try a few things before you take a look at this, I’ll get back to you…I need to update the whole codebase to include all your newest changes then try rebuilding everything and see if that solves the problem.

I actually already checked in a fix.

FYI, there’s some crufty old code in that host example - it’s pretty old and could use a serious clean-up. Try not to use it as an example of good practice!

You’re scary good Jules…it’s pretty humbling…But that crufty old code is now built into StageManager, so far so good - and I really appreciate the quick fixes…I end up futzing around at that level and don’t get all that much accomplished (yet), one of these days the forum will promote me but I’m not there yet…

The fix posted by graeme solved the white GUI problem for me - but added another one: plugins are not getting keypress events any more. Any idea what could cause this ?