diff options
author | Adam Jackson <ajax@redhat.com> | 2015-12-08 15:08:34 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-12-08 18:22:54 -0500 |
commit | 8c49c883dc196ea57e3f64425c2a5b0a8ce3ba75 (patch) | |
tree | b88920edd3a7e378cbb7a6502dd23dc9990fbb24 /Xext | |
parent | b5f04a79df8b5aab8b558461261d14721f0b3e41 (diff) |
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 <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/sync.c | 21 |
1 files changed, 3 insertions, 18 deletions
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"); |