Tooltip crash

15 posts / 0 new
Last post
RiphRaph
Offline
Last seen: 1 hour 1 min ago
Joined: 12 Oct 2010 - 10:11
Tooltip crash

Hi,
There's a bug with the tooltips on the VST PC audio plugins. RTAS PC plugins and Mac plugins don't crash.
Printing tooltips on screen makes my VST plugin crash at the DAW closing (Reaper, Cubase, Live).
I've done a quick test by simply adding a tooltip to a slider of the demo plugin and the crash also happens.

PluginEditor.h:

	ScopedPointer<TooltipWindow> tooltipWindow;

PluginEditor.cpp: in the constructor

	tooltipWindow = new TooltipWindow(this, 0);
...
	gainSlider.setTooltip("Hello");

Other info:
- DirectWrite is not activated.
- The bug occurs since I've been using the new "modules" library. Plugins built with juce version prior to 1.54.27 work fine.
- Juce version: 2.0.21
- same problem on 32 and 64-bit plugins

Any ideas how to fix it?
Thanks

jules
Online
Last seen: 11 min 41 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Tooltip crash

You'll be deleting a dangling pointer. I bet you're calling deleteAllChildren() in your editor, and so deleting the tooltip window twice.

chkn
Offline
Last seen: 2 days 2 hours ago
Joined: 8 Mar 2007 - 17:17
Re: Tooltip crash

Debug it - would like to see the callstack.

Jules: there are sometimes issues with open windows after the plugin gets destroyed by the host (but my problem is on mac side http://rawmaterialsoftware.com/viewtopic.php?f=8&t=8671 )
Do you see any way to dispatch the message-thread after all windows are closed, before the plugin instance gets destroyed ?

jules
Online
Last seen: 11 min 41 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Tooltip crash

In this case he's adding the tooltip to the editor, not putting it on the desktop.

Clearing out the message queue is an old problem, and AFAIK no perfect solution is possible from the plugin's side.

chkn
Offline
Last seen: 2 days 2 hours ago
Joined: 8 Mar 2007 - 17:17
Re: Tooltip crash

ooops :oops:

RiphRaph
Offline
Last seen: 1 hour 1 min ago
Joined: 12 Oct 2010 - 10:11
Re: Tooltip crash

No I haven't got any deleteAllChildren() in my destructor. And as I said, the demo plugin, which has a empty destructor, crashes too.
It might come from juce_VST_wrapper.cpp that doen't properly close down the editor.

The DAW callstack doesn't help, as you can see:

 	
ntdll.dll!76f99b01() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]	
 	ntdll.dll!76fb7d8a() 	
 	ntdll.dll!76fb801e() 	
 	ntdll.dll!76fb8256() 	
 	kernel32.dll!755a3677() 	
 	ntdll.dll!76f99f42() 	
 	ntdll.dll!76f99f15() 
chkn
Offline
Last seen: 2 days 2 hours ago
Joined: 8 Mar 2007 - 17:17
Re: Tooltip crash

-edit deleted

jules
Online
Last seen: 11 min 41 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Tooltip crash

Ah, I see.. well that doesn't even look like there's any of the plugin's code on the callstack. This sounds like it might be what chkn suggested, i.e. the host doesn't provide enough time for the window to get deleted before unloading the dll. Tricky to work around that one, but you could try deleting the window and briefly running he message loop to let it clear up.

RiphRaph
Offline
Last seen: 1 hour 1 min ago
Joined: 12 Oct 2010 - 10:11
Re: Tooltip crash

What do you mean by running the message loop?

jules
Online
Last seen: 11 min 41 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Tooltip crash

I mean using MessageManager::runDispatchLoopUntil. It's very dangerous to do this, but if the host doesn't give the plugin chance to clear up, it can sometimes be the only option.

RiphRaph
Offline
Last seen: 1 hour 1 min ago
Joined: 12 Oct 2010 - 10:11
Re: Tooltip crash

I finally sorted out!
I thought JUCE_USE_DIRECTWRITE was undefined as it is uncommented in AppConfig.h but in fact it is defined in juce_graphics.h.
I followed the tooltip drawing trace up to TextLayout::createNativeLayout() in juce_win32_DirectWriteTypeLayout.cpp to figure it out.
So I commented JUCE_USE_DIRECTWRITE out and now it works fine.

Pages