WTelegramClient icon indicating copy to clipboard operation
WTelegramClient copied to clipboard

Collection was modified; enumeration operation may not execute.

Open devtunnelx opened this issue 7 months ago • 0 comments

Version: 4.1.2-dev.7

I'm having an issue when using UpdateManager.CollectUsersChats()

Exception keeps thrown after running the app (like 30 minutes or 45 later)

Collection was modified; enumeration operation may not execute.

Current code:

  var users = new Dictionary<long, User>();
  var chats = new Dictionary<long, ChatBase>();

                lock (_updatesManagerLock)
                {
                    var manager = _updateManagers[client];
                    manager.CollectUsersChats(users, chats);
   
                }

Even when using _lock and thread safety masques, i still get the error at manager.CollectUsersChats(users, chats);

devtunnelx avatar Jun 30 '24 14:06 devtunnelx