Platform/Unix/X11SharedDisplay: pass a pointer to the display to XReleaseDisplay() just to be sure client code has a valid pointer
This commit is contained in:
parent
782f116d7c
commit
10e1a9071e
8 changed files with 12 additions and 9 deletions
|
|
@ -160,7 +160,7 @@ void GLXContext::destroy()
|
|||
}
|
||||
|
||||
if (m_disp) {
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(m_disp);
|
||||
m_disp = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ void PlatformMisc::GetDisplayModes(std::vector<DisplayMode>& modes)
|
|||
Log::error("Failed to use XRandR extension while trying to get display modes.");
|
||||
}
|
||||
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(disp);
|
||||
} else {
|
||||
Log::error("Failed to connect to the X server while trying to get display modes.");
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ DisplayMode PlatformMisc::GetDesktopMode()
|
|||
Log::error("Failed to use XRandR extension while trying to get desktop display mode.");
|
||||
}
|
||||
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(disp);
|
||||
} else {
|
||||
Log::error("Failed to connect to the X server while trying to get desktop display mode.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ void X11Display::destroy()
|
|||
}
|
||||
|
||||
if (m_disp) {
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(m_disp);
|
||||
m_disp = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ X11EventQueue::X11EventQueue()
|
|||
X11EventQueue::~X11EventQueue()
|
||||
{
|
||||
if (m_disp) {
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(m_disp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ m_disp(NULL)
|
|||
X11Keyboard::~X11Keyboard()
|
||||
{
|
||||
if (m_disp) {
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(m_disp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ m_btn_state(0)
|
|||
X11Mouse::~X11Mouse()
|
||||
{
|
||||
if (m_disp) {
|
||||
XReleaseDisplay();
|
||||
XReleaseDisplay(m_disp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include "X11SharedDisplay.h"
|
||||
|
||||
namespace sp {
|
||||
|
|
@ -18,7 +19,9 @@ unsigned int refcount = 0;
|
|||
return sharedDisplay;
|
||||
}
|
||||
|
||||
void XReleaseDisplay() {
|
||||
void XReleaseDisplay(::Display* disp) {
|
||||
|
||||
assert(disp == sharedDisplay);
|
||||
|
||||
if (refcount < 1) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace sp {
|
|||
|
||||
::Display* XGetDisplay();
|
||||
|
||||
void XReleaseDisplay();
|
||||
void XReleaseDisplay(::Display* disp);
|
||||
|
||||
Atom getAtom(const std::string& name, bool onlyIfExists = false);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue