mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-03 03:30:06 +00:00
Made ResizableWindow slightly more resilient. Added a method to OwnedArray.
This commit is contained in:
parent
b232c71419
commit
79b8ffa007
13 changed files with 127 additions and 95 deletions
|
|
@ -78,7 +78,8 @@ ResizableWindow::~ResizableWindow()
|
|||
{
|
||||
resizableCorner = 0;
|
||||
resizableBorder = 0;
|
||||
contentComponent = 0;
|
||||
deleteAndZero (contentComponent); // (avoid using a scoped pointer for this, so that it survives
|
||||
// external deletion of the content comp)
|
||||
|
||||
// have you been adding your own components directly to this window..? tut tut tut.
|
||||
// Read the instructions for using a ResizableWindow!
|
||||
|
|
@ -104,9 +105,9 @@ void ResizableWindow::setContentComponent (Component* const newContentComponent,
|
|||
|
||||
if (newContentComponent != static_cast <Component*> (contentComponent))
|
||||
{
|
||||
if (! deleteOldOne)
|
||||
removeChildComponent (contentComponent.release());
|
||||
|
||||
if (deleteOldOne)
|
||||
delete static_cast <Component*> (contentComponent); // (avoid using a scoped pointer for this, so that it survives
|
||||
// external deletion of the content comp)
|
||||
contentComponent = newContentComponent;
|
||||
|
||||
Component::addAndMakeVisible (contentComponent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue