mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
DemoRunner: Protect against null peer when updating renderer
This commit is contained in:
parent
8fd73d33a8
commit
0a71227126
1 changed files with 4 additions and 2 deletions
|
|
@ -442,7 +442,7 @@ void MainComponent::parentHierarchyChanged()
|
|||
#if JUCE_ANDROID
|
||||
currentRenderingEngineIdx = (renderingEngines.size() - 1);
|
||||
#else
|
||||
currentRenderingEngineIdx = peer->getCurrentRenderingEngine();
|
||||
currentRenderingEngineIdx = peer != nullptr ? peer->getCurrentRenderingEngine() : -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -462,7 +462,9 @@ void MainComponent::updateRenderingEngine (int renderingEngineIndex)
|
|||
else
|
||||
{
|
||||
openGLContext.detach();
|
||||
peer->setCurrentRenderingEngine (renderingEngineIndex);
|
||||
|
||||
if (peer != nullptr)
|
||||
peer->setCurrentRenderingEngine (renderingEngineIndex);
|
||||
}
|
||||
|
||||
currentRenderingEngineIdx = renderingEngineIndex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue