Crash latest Tip - Introjucer

When trying to add files to the tree, Windows

 


First-chance exception at 0x00774B3D in The Introjucer.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x00774B3D in The Introjucer.exe: 0xC0000005: Access violation reading location 0x00000000.
 

 

       if (font->getTypefaceStyle() == getFontFaceName (dwFont))
                    break;
            }
  crash here>>>>       textLayout->SetFontFamilyName (familyName.toWideCharPointer(), range);
            textLayout->SetFontWeight (dwFont->GetWeight(), range);

Callstack

 

 


 

>    The Introjucer.exe!juce::DirectWriteTypeLayout::addAttributedRange(const juce::AttributedString::Attribute & attr={...}, IDWriteTextLayout * textLayout=0x00000000, const int textLen=28, ID2D1RenderTarget * const renderTarget=0x013eb300, IDWriteFontCollection * const fontCollection=0x013e87b8) Line 249    C++
     The Introjucer.exe!juce::DirectWriteTypeLayout::setupLayout(const juce::AttributedString & text={...}, const float maxWidth=-12.0000000, const float maxHeight=10000000.0, ID2D1RenderTarget * const renderTarget=0x013eb300, IDWriteFactory * const directWriteFactory=0x013e81c0, IDWriteFontCollection * const fontCollection=0x013e87b8, IDWriteTextLayout * * dwTextLayout=0x00e6edc8) Line 314    C++
     The Introjucer.exe!juce::DirectWriteTypeLayout::createLayout(juce::TextLayout & layout={...}, const juce::AttributedString & text={...}, IDWriteFactory * const directWriteFactory=0x013e81c0, ID2D1Factory * const direct2dFactory=0x013e7ff8, IDWriteFontCollection * const fontCollection=0x013e87b8) Line 333    C++
     The Introjucer.exe!juce::TextLayout::createNativeLayout(const juce::AttributedString & text={...}) Line 396    C++
     The Introjucer.exe!juce::TextLayout::createLayout(const juce::AttributedString & text={...}, float maxWidth=-12.0000000) Line 229    C++
     The Introjucer.exe!juce::FileChooserDialogBox::ContentComponent::resized() Line 62    C++
     The Introjucer.exe!juce::ResizableWindow::setContent(juce::Component * newContentComponent=0x05da0bd0, bool takeOwnership=true, bool resizeToFitWhenContentChangesSize=false) Line 134    C++
     The Introjucer.exe!juce::ResizableWindow::setContentOwned(juce::Component * newContentComponent=0x05da0bd0, bool resizeToFitWhenContentChangesSize=false) Line 139    C++
     The Introjucer.exe!juce::FileChooserDialogBox::FileChooserDialogBox(const juce::String & name={...}, const juce::String & instructions={...}, juce::FileBrowserComponent & chooserComponent={...}, bool warnAboutOverwritingExistingFiles_=false, juce::Colour backgroundColour={...}) Line 101    C++
     The Introjucer.exe!juce::FileChooser::showDialog(int flags=29, juce::FilePreviewComponent * previewComp=0x00000000) Line 121    C++
     The Introjucer.exe!juce::FileChooser::browseForMultipleFilesOrDirectories(juce::FilePreviewComponent * previewComp=0x00000000) Line 63    C++
     The Introjucer.exe!ProjectTreeViewBase::browseToAddExistingFiles() Line 66    C++
     The Introjucer.exe!GroupTreeViewItem::processCreateFileMenuItem(int menuID=1002) Line 172    C++
     The Introjucer.exe!GroupTreeViewItem::handlePopupMenuResult(int resultCode=1002) Line 156    C++
     The Introjucer.exe!treeViewMenuItemChosen(int resultCode=1002, juce::WeakReference<JucerTreeViewBase,juce::ReferenceCountedObject> item={...}) Line 218    C++
     The Introjucer.exe!juce::ModalCallbackFunction::FunctionCaller1<juce::WeakReference<JucerTreeViewBase,juce::ReferenceCountedObject> >::modalStateFinished(int returnValue=1002) Line 287    C++
     The Introjucer.exe!juce::ModalComponentManager::handleAsyncUpdate() Line 197    C++
     The Introjucer.exe!juce::AsyncUpdater::AsyncUpdaterMessage::messageCallback() Line 34    C++
     The Introjucer.exe!juce::WindowsMessageHelpers::dispatchMessageFromLParam(long lParam=16967344) Line 49    C++
     The Introjucer.exe!juce::MessageManager::dispatchNextMessageOnSystemQueue(bool returnIfNoPendingMessages=false) Line 110    C++
     The Introjucer.exe!juce::MessageManager::runDispatchLoopUntil(int millisecondsToRunFor=-1) Line 115    C++
     The Introjucer.exe!juce::MessageManager::runDispatchLoop() Line 97    C++
     The Introjucer.exe!juce::JUCEApplicationBase::main() Line 239    C++
     The Introjucer.exe!WinMain(void * __formal=0x001c0000, void * __formal=0x00000000, const char * __formal=0x00fc4be8, int __formal=10) Line 27    C++
     The Introjucer.exe!__tmainCRTStartup() Line 238    C
     The Introjucer.exe!WinMai nCRTStartup() Line 164    C

Goddammit, Windows, why call that function with a null pointer for the layout object??

Thanks, I guess I just need to add a null pointer test there. Presumably the layout was empty, so it decided not to bother creating one.

Still Crash

 hr = dwTextLayout->GetLineMetrics (nullptr, 0, &actualLineCount);

 

dwTextLayout is nullptr

 


>    The Introjucer.exe!juce::DirectWriteTypeLayout::createLayout(juce::TextLayout & layout={...}, const juce::AttributedString & text={...}, IDWriteFactory * const directWriteFactory=0x012781d0, ID2D1Factory * const direct2dFactory=0x01278008, IDWriteFontCollection * const fontCollection=0x012787c8) Line 339    C++
     The Introjucer.exe!juce::TextLayout::createNativeLayout(const juce::AttributedString & text={...}) Line 399    C++
     The Introjucer.exe!juce::TextLayout::createLayout(const juce::AttributedString & text={...}, float maxWidth=-12.0000000) Line 229    C++
     The Introjucer.exe!juce::FileChooserDialogBox::ContentComponent::resized() Line 62    C++
     The Introjucer.exe!juce::ResizableWindow::setContent(juce::Component * newContentComponent=0x0499a760, bool takeOwnership=true, bool resizeToFitWhenContentChangesSize=false) Line 134    C++
     The Introjucer.exe!juce::ResizableWindow::setContentOwned(juce::Component * newContentComponent=0x0499a760, bool resizeToFitWhenContentChangesSize=false) Line 139    C++
     The Introjucer.exe!juce::FileChooserDialogBox::FileChooserDialogBox(const juce::String & name={...}, const juce::String & instructions={...}, juce::FileBrowserComponent & chooserComponent={...}, bool warnAboutOverwritingExistingFiles_=false, juce::Colour backgroundColour={...}) Line 101    C++
     The Introjucer.exe!juce::FileChooser::showDialog(int flags=29, juce::FilePreviewComponent * previewComp=0x00000000) Line 121    C++
     The Introjucer.exe!juce::FileChooser::browseForMultipleFilesOrDirectories(juce::FilePreviewComponent * previewComp=0x00000000) Line 63    C++
     The Introjucer.exe!FileTreePanel::ProjectTreeItemBase::browseToAddExistingFiles() Line 147    C++
     The Introjucer.exe!FileTreePanel::GroupItem::processCreateFileMenuItem(int menuID=1002) Line 165    C++
     The Introjucer.exe!FileTreePanel::GroupItem::handlePopupMenuResult(int resultCode=1002) Line 149    C++
     The Introjucer.exe!treeViewMenuItemChosen(int resultCode=1002, juce::WeakReference<JucerTreeViewBase,juce::ReferenceCountedObject> item={...}) Line 218    C++
     The Introjucer.exe!juce::ModalCallbackFunction::FunctionCaller1<juce::WeakReference<JucerTreeViewBase,juce::ReferenceCountedObject> >::modalStateFinished(int returnValue=1002) Line 287    C++
     The Introjucer.exe!juce::ModalComponentManager::handleAsyncUpdate() Line 197    C++
     The Introjucer.exe!juce::AsyncUpdater::AsyncUpdaterMessage::messageCallback() Line 34    C++
     The Introjucer.exe!juce::WindowsMessageHelpers::dispatchMessageFromLParam(long lParam=22316704) Line 49    C++
     The Introjucer.exe!juce::MessageManager::dispatchNextMessageOnSystemQueue(bool returnIfNoPendingMessages=false) Line 110    C++
     The Introjucer.exe!juce::MessageManager::runDispatchLoopUntil(int millisecondsToRunFor=-1) Line 115    C++

Ok, have added more checking. (No idea what you're doing to trigger the problem though)

I just add want to add 2 files to the filetree

after clicking "add existing files" (screenshort from no directwrite version, which is working)