pCt -> g_iRefCount
This commit is contained in:
@@ -7,9 +7,11 @@
|
|||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "RageThreads.h"
|
#include "RageThreads.h"
|
||||||
|
|
||||||
static vector<long> g_aiMasks; // Currently open masks
|
// Currently open masks:
|
||||||
static unsigned short int pCt = 0; // Number of subsystems
|
static vector<long> g_aiMasks;
|
||||||
// using the X connection
|
|
||||||
|
// Number of subsystems using the X connection:
|
||||||
|
static unsigned short int g_iRefCount = 0;
|
||||||
|
|
||||||
Display *X11Helper::Dpy = NULL;
|
Display *X11Helper::Dpy = NULL;
|
||||||
Window X11Helper::Win;
|
Window X11Helper::Win;
|
||||||
@@ -19,7 +21,7 @@ int protoFatalCallback( Display* );
|
|||||||
|
|
||||||
bool X11Helper::Go()
|
bool X11Helper::Go()
|
||||||
{
|
{
|
||||||
if( pCt == 0 )
|
if( g_iRefCount == 0 )
|
||||||
{
|
{
|
||||||
Dpy = XOpenDisplay(0);
|
Dpy = XOpenDisplay(0);
|
||||||
if( Dpy == NULL )
|
if( Dpy == NULL )
|
||||||
@@ -28,16 +30,16 @@ bool X11Helper::Go()
|
|||||||
XSetIOErrorHandler( &protoFatalCallback );
|
XSetIOErrorHandler( &protoFatalCallback );
|
||||||
XSetErrorHandler( &protoErrorCallback );
|
XSetErrorHandler( &protoErrorCallback );
|
||||||
}
|
}
|
||||||
pCt++;
|
g_iRefCount++;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void X11Helper::Stop()
|
void X11Helper::Stop()
|
||||||
{
|
{
|
||||||
pCt--;
|
g_iRefCount--;
|
||||||
|
|
||||||
if( pCt == 0 )
|
if( g_iRefCount == 0 )
|
||||||
{
|
{
|
||||||
XCloseDisplay( Dpy );
|
XCloseDisplay( Dpy );
|
||||||
Dpy = NULL; // For sanity's sake
|
Dpy = NULL; // For sanity's sake
|
||||||
@@ -90,7 +92,7 @@ bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width,
|
|||||||
static bool pHaveWin = false;
|
static bool pHaveWin = false;
|
||||||
vector<long>::iterator i;
|
vector<long>::iterator i;
|
||||||
|
|
||||||
if( pCt == 0 )
|
if( g_iRefCount == 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( pHaveWin )
|
if( pHaveWin )
|
||||||
|
|||||||
Reference in New Issue
Block a user