From 8c49c883dc196ea57e3f64425c2a5b0a8ce3ba75 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 8 Dec 2015 15:08:34 -0500 Subject: sync: Don't allow creating a system counter before sync is initialized 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 Signed-off-by: Adam Jackson --- Xext/sync.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'Xext/sync.c') diff --git a/Xext/sync.c b/Xext/sync.c index 41405619c..4c59fea08 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -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; @@ -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"); -- cgit v1.2.3