Why does the Introjucer do this:
//header
ScopedPointer<ToggleButton> toggleButton;
//
//==============================================================================
MyComponent::MyComponent ()
{
addAndMakeVisible (toggleButton = new ToggleButton ("new toggle button"));
toggleButton->addListener (this);
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
MyComponent::~MyComponent()
{
//[Destructor_pre]. You can add your own custom destruction code here..
//[/Destructor_pre]
toggleButton = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
Because the toggleButton is a scopedPointer, why would we need to put ‘toggleButton = nullptr’, it will go out of scoped and get deleted.
Just wondering as i’m using the Introjucer now a lot while converting our Juce 1.50 based project, just wondering if i’m not making wrong assumptions.