Bugfix
This commit is contained in:
parent
51516f9d54
commit
b6de3cf3bb
@ -118,7 +118,7 @@ public class InternalClient implements ClientEventsHandler, TelegramClient {
|
|||||||
this.updateHandler = null;
|
this.updateHandler = null;
|
||||||
this.updatesHandler = new MultiHandler(updatesHandler, updateExceptionHandler);
|
this.updatesHandler = new MultiHandler(updatesHandler, updateExceptionHandler);
|
||||||
this.defaultExceptionHandler = defaultExceptionHandler;
|
this.defaultExceptionHandler = defaultExceptionHandler;
|
||||||
createAndRegisterClient(clientId);
|
createAndRegisterClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -128,13 +128,14 @@ public class InternalClient implements ClientEventsHandler, TelegramClient {
|
|||||||
this.updateHandler = new Handler(updateHandler, updateExceptionHandler);
|
this.updateHandler = new Handler(updateHandler, updateExceptionHandler);
|
||||||
this.updatesHandler = null;
|
this.updatesHandler = null;
|
||||||
this.defaultExceptionHandler = defaultExceptionHandler;
|
this.defaultExceptionHandler = defaultExceptionHandler;
|
||||||
createAndRegisterClient(clientId);
|
createAndRegisterClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAndRegisterClient(int clientId) {
|
private void createAndRegisterClient() {
|
||||||
synchronized (nextClientIdLock) {
|
synchronized (nextClientIdLock) {
|
||||||
int nextClientId = InternalClient.nextClientId++;
|
int nextClientId = InternalClient.nextClientId++;
|
||||||
clientManager.registerClient(clientId, this);
|
System.out.println("Registering client " + nextClientId);
|
||||||
|
clientManager.registerClient(nextClientId, this);
|
||||||
this.clientId = NativeClientAccess.create();
|
this.clientId = NativeClientAccess.create();
|
||||||
if (this.clientId != nextClientId) {
|
if (this.clientId != nextClientId) {
|
||||||
throw new RuntimeException("FATAL ERROR 00 -- REPORT AT https://github.com/tdlight-team/tdlight-java/issues");
|
throw new RuntimeException("FATAL ERROR 00 -- REPORT AT https://github.com/tdlight-team/tdlight-java/issues");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user