mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Linux: Check parent window is still valid before unmapping/destroying embedded OpenGL window
This commit is contained in:
parent
e9321bf565
commit
a95ec7bc8f
1 changed files with 11 additions and 7 deletions
|
|
@ -126,13 +126,17 @@ public:
|
|||
|
||||
~NativeContext()
|
||||
{
|
||||
juce_LinuxRemoveRepaintListener (component.getPeer(), &dummy);
|
||||
|
||||
if (embeddedWindow != 0)
|
||||
if (auto* peer = component.getPeer())
|
||||
{
|
||||
XWindowSystemUtilities::ScopedXLock xLock;
|
||||
X11Symbols::getInstance()->xUnmapWindow (display, embeddedWindow);
|
||||
X11Symbols::getInstance()->xDestroyWindow (display, embeddedWindow);
|
||||
juce_LinuxRemoveRepaintListener (peer, &dummy);
|
||||
|
||||
if (embeddedWindow != 0)
|
||||
{
|
||||
XWindowSystemUtilities::ScopedXLock xLock;
|
||||
X11Symbols::getInstance()->xUnmapWindow (display, embeddedWindow);
|
||||
X11Symbols::getInstance()->xDestroyWindow (display, embeddedWindow);
|
||||
X11Symbols::getInstance()->xSync (display, True);
|
||||
}
|
||||
}
|
||||
|
||||
if (bestVisual != nullptr)
|
||||
|
|
@ -233,7 +237,7 @@ private:
|
|||
GLXContext renderContext = {};
|
||||
Window embeddedWindow = {};
|
||||
|
||||
int swapFrames = 0;
|
||||
int swapFrames = 1;
|
||||
Rectangle<int> bounds;
|
||||
XVisualInfo* bestVisual = nullptr;
|
||||
void* contextToShareWith;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue