Browse Source

Avoided a dangling pointer in the projucer

tags/2021-05-28
jules 6 years ago
parent
commit
fc4449b212
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      extras/Projucer/Source/Application/jucer_MainWindow.cpp

+ 2
- 2
extras/Projucer/Source/Application/jucer_MainWindow.cpp View File

@@ -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…
Cancel
Save