1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Linux: Don't call XFreeCursor() on invalid display

This commit is contained in:
ed 2020-06-05 17:17:52 +01:00
parent ce16bd3df9
commit 945cf12581

View file

@ -4114,15 +4114,13 @@ void MouseCursor::showInWindow (ComponentPeer* peer) const
{
if (auto* lp = dynamic_cast<LinuxComponentPeer*> (peer))
{
auto cursor = (Cursor) getHandle();
ScopedXDisplay xDisplay;
auto cursor = (Cursor) getHandle();
auto cursorDisplay = cursorMap[cursor];
if (cursorHandle != nullptr && xDisplay.display != cursorDisplay)
if (cursorHandle != nullptr && xDisplay.display != cursorMap[cursor])
{
cursorMap.erase (cursor);
XFreeCursor (cursorDisplay, cursor);
if (auto* customInfo = cursorHandle->getCustomInfo())
cursorHandle->setHandle (customInfo->create());