Unable to use setTitleBarButtonsRequired with LaunchOptions.launchAsync

I’m trying to call the setTitleBarButtonsRequired function on a juce::DialogWindow* returned from calling LaunchOptions.launchAsync to remove all titlebar buttons from the titlebar however this seems to cause the DialogWindow to appear briefly before vanishing.

I have tested this with a basic GUI application that creates a LauchOptions object, sets the content to a basic component with a text button on it, and calls launchAsync. This works fine without the call to setTitleBarButtonsRequired in there, the dialog window shows with the default close button in the titlebar.It also works calling setTitleBarButtonsRequired(4, false) which also shows just the close button in the titlebar. Trying to call setTitleBarButtonsRequired(0, false) is what causes the DialogWindow to vanish.

MainComponent::MainComponent()
  : m_dialogWindowButton()
{
  setSize( 600, 400 );

  juce::DialogWindow::LaunchOptions launchOptions;
  juce::Component* newComponent = new juce::Component();

  newComponent->setBounds( 0, 0, 800, 600 );

  m_dialogWindowButton.setButtonText( "hello world" );

  newComponent->addAndMakeVisible( m_dialogWindowButton );

  m_dialogWindowButton.setBounds( 10, 10, 100, 70 );

  launchOptions.content.setOwned( newComponent );

  juce::DialogWindow* pWindow = launchOptions.launchAsync();

  pWindow->setSize( 800, 600 );

  pWindow->setTitleBarButtonsRequired( 0, false );
}

This does not seem to be an OS limitation as the following code produces a DialogWindow with no titlebar buttons.

  juce::DialogWindow* pWindow = launchOptions.create();

  pWindow->setSize( 800, 600 );

  pWindow->setTitleBarButtonsRequired( 0, false );

  pWindow->enterModalState();

I have only tried this on Windows so far so can’t say whether the same thing happens on any other OSs
Tested with version 7.0.5