mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Avoided a dangling pointer in the projucer
This commit is contained in:
parent
723b18a149
commit
fc4449b212
1 changed files with 2 additions and 2 deletions
|
|
@ -688,7 +688,7 @@ bool MainWindowList::openFile (const File& file, bool openInBackground)
|
|||
|
||||
if (file.hasFileExtension (Project::projectFileExtension))
|
||||
{
|
||||
auto previousFrontWindow = getFrontmostWindow();
|
||||
WeakReference<Component> previousFrontWindow (getFrontmostWindow());
|
||||
|
||||
auto* w = getOrCreateEmptyWindow();
|
||||
bool ok = w->openFile (file);
|
||||
|
|
@ -703,7 +703,7 @@ bool MainWindowList::openFile (const File& file, bool openInBackground)
|
|||
closeWindow (w);
|
||||
}
|
||||
|
||||
if (openInBackground && (previousFrontWindow != nullptr))
|
||||
if (openInBackground && previousFrontWindow != nullptr)
|
||||
previousFrontWindow->toFront (true);
|
||||
|
||||
return ok;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue