Skip to content

Commit

Permalink
sync: Don't allow creating a system counter before sync is initialized
Browse files Browse the repository at this point in the history
It probably doesn't work very well since there's other extension setup
we're not doing on this path, and in any event it's not a thing that
happens currently.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
  • Loading branch information
nwnk committed Dec 8, 2015
1 parent b5f04a7 commit 8c49c88
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions Xext/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,20 +984,7 @@ SyncCreateSystemCounter(const char *name,
SyncSystemCounterBracketValues BracketValues
)
{
SyncCounter *pCounter;

/* this function may be called before SYNC has been initialized, so we
* have to make sure RTCounter is created.
*/
if (RTCounter == 0) {
RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
if (RTCounter == 0) {
return NULL;
}
xorg_list_init(&SysCounterList);
}

pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
SyncCounter *pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);

if (pCounter) {
SysCounterInfo *psci;
Expand Down Expand Up @@ -2501,10 +2488,8 @@ SyncExtensionInit(void)
for (s = 0; s < screenInfo.numScreens; s++)
miSyncSetup(screenInfo.screens[s]);

if (RTCounter == 0) {
RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
xorg_list_init(&SysCounterList);
}
RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
xorg_list_init(&SysCounterList);
RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");
RTFence = CreateNewResourceType(FreeFence, "SyncFence");
Expand Down

0 comments on commit 8c49c88

Please sign in to comment.