TreeView in 32-Bit


#1

I’m on Mac OS 10.7.5, XCode 4.6.1, JUCE 2.0.38. When I compile my app with a 64 bit scheme, everything loads, and all is well. If I switch to the 32 bit scheme, it builds, but when it tries to run it freezes up for a second and crashes with BAD_ACCESS. Here’s the stack trace:

// crashes in Rectangle method with BAD_ACCESS
#0	0x001b7fdd in juce::Rectangle<int>::Rectangle(int, int, int, int) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_audio_utils/../juce_gui_basics/../juce_graphics/colour/../images/../contexts/../geometry/juce_Rectangle.h:63
#1	0x001b328d in juce::Rectangle<int>::Rectangle(int, int, int, int) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_audio_utils/../juce_gui_basics/../juce_graphics/colour/../images/../contexts/../geometry/juce_Rectangle.h:64
#2	0x00325444 in juce::Rectangle<int>::operator+(juce::Point<int> const&) const at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_graphics/colour/../images/../contexts/../geometry/juce_Rectangle.h:272
#3	0x00452e7a in juce::Component::ComponentHelpers::convertToParentSpace(juce::Component const&, juce::Rectangle<int> const&) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:231
#4	0x00399ece in juce::Component::internalRepaintUnchecked(juce::Rectangle<int> const&, bool) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1809
#5	0x0039a053 in juce::Component::internalRepaint(juce::Rectangle<int> const&) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1782
.
.
.
//calls internalRepaint and internalRepaintUnchecked about 95000 times...
.
.
.
#95280	0x00399ee3 in juce::Component::internalRepaintUnchecked(juce::Rectangle<int> const&, bool) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1809
#95281	0x0039a053 in juce::Component::internalRepaint(juce::Rectangle<int> const&) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1782
#95282	0x00393dd0 in juce::Component::repaintParent() at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1774
#95283	0x0039880d in juce::Component::addChildComponent(juce::Component*, int) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1365
#95284	0x0039895f in juce::Component::addAndMakeVisible(juce::Component*, int) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Component.cpp:1393
#95285	0x004d3169 in juce::TreeView::ContentComponent::updateComponents() at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/widgets/juce_TreeView.cpp:193
#95286	0x004715ea in juce::TreeView::TreeViewport::updateComponents(bool) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/widgets/juce_TreeView.cpp:402
#95287	0x00431a64 in juce::TreeView::recalculateIfNeeded() at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/widgets/juce_TreeView.cpp:843
#95288	0x004337f7 in juce::TreeView::resized() at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/widgets/juce_TreeView.cpp:665
#95289	0x00431d8e in juce::TreeView::setIndentSize(int) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../JuceLibraryCode/modules/juce_gui_basics/widgets/juce_TreeView.cpp:519
#95290	0x000503f2 in SidebarComponent::SidebarComponent(juce::XmlElement*) at /Users/Joe/Developer/Syntorial/Builds/MacOSX/../../Source/SidebarComponent.cpp:323

And here’s the snippet of code that calls setIndentSize():

SidebarComponent::SidebarComponent (XmlElement* master_)
: label (0),
ovTreeView (0),
master (master_)
{
	rootItem = new OVTreeViewItem (*master);
	rootItem->setOpen (true);
	addAndMakeVisible (ovTreeView = new TreeView ());
	ovTreeView->setRootItem(rootItem);
	ovTreeView->setRootItemVisible(false);
	ovTreeView->setOpenCloseButtonsVisible(false);
	ovTreeView->setIndentSize(0);
        // etc.....

Doesn’t just happen with treeView->setIndentSize(), also happens with treeView->setBounds. Happens whether my lion os is booted in 32 or 64 bit mode. If I prevent the component that holds the treeView from being built at all, the app loads fine (albeit, without the treeview) without crashes, in 32 bit and 64 bit schemes. Is the internalPaint and internalPaintUnchecked suppose to run that many times?


#2

Clean, Rebuild.

As well, check you’re using the same Juce header when compiling Juce or includes in your code


#3

Error is still there after clean and rebuild.

As for my JUCE include, I just have this in a few of my header files:

#include "../JuceLibraryCode/JuceHeader.h"

I’m not sure if and how it could change along with my scheme?