You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a sanity check that fires when app tries to destroy a client, which is still used in other thread by td_json_client_receive. You must first stop to use the client and only after that you can call td_json_client_destroy.
The usual way to do that is to call the method close, then wait for updateAuthoriationState with state authorizationStateClosed, stop calling td_json_client_receive and call td_json_client_destroy.
TDLib doesn't allow to call td_json_client_destroy while td_json_client_receive is running in another thread. It can happen in tdl, since it uses libuv threadpool to asynchronously call those methods.
So await client.invoke({ _: 'close' }) should be used instead of client.destroy() (which just calls internal td_json_client_destroy). tdl will call destroy automatically when it receives authorizationStateClosed.
Maybe client.destroy should be removed from the public interface in the next major version.
The text was updated successfully, but these errors were encountered:
tdlib/td#594 (comment), tdlib/td#771 (comment):
TDLib doesn't allow to call td_json_client_destroy while td_json_client_receive is running in another thread. It can happen in tdl, since it uses libuv threadpool to asynchronously call those methods.
So
await client.invoke({ _: 'close' })
should be used instead ofclient.destroy()
(which just calls internaltd_json_client_destroy
). tdl will calldestroy
automatically when it receivesauthorizationStateClosed
.Maybe
client.destroy
should be removed from the public interface in the next major version.The text was updated successfully, but these errors were encountered: