1
0
Fork 0
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:
jules 2018-10-18 12:41:03 +01:00
parent 723b18a149
commit fc4449b212

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;