From: Manuel Nickschas Date: Sun, 2 Mar 2014 20:19:34 +0000 (+0100) Subject: Simplify clean-up-on-network-disconnect handling X-Git-Tag: 0.10-rc1~9 X-Git-Url: https://git.quassel-irc.org/?a=commitdiff_plain;h=44212b2131e958c40ca26b9f49289590d8f83145;hp=44212b2131e958c40ca26b9f49289590d8f83145;p=quassel.git Simplify clean-up-on-network-disconnect handling Previously, disconnecting from a network would trigger lots of unnecessary stuff: because the NetworkModel needs to remove affected IrcChannels and IrcUsers from its model items, we would trigger (on the core side!) an IrcUser::quit() for every known user in that network, which would then remove itself from all channels it's in, triggering the corresponding updates in the related SyncableObjects, which would send lots of signals to the client which would then perform its own cleanups per IrcUser, followed by throwing away all IrcChannels and IrcUsers in that network anyway. By the time we reached Network::removeChansAndUsers(), everything would actually be already all gone triggered through syncobject updates. Except in some rare cases when there was still something left behind, triggering the dreaded "!_ircChannel && ircChannel" assert, that users have been reporting for years. I still haven't figured out how that could possibly happen. In any case, the only side effect that explicit call to IrcUser::quit() was supposed to trigger was the removal of the relevant references in NetworkModel's items. So now we just brutally delete all IrcUsers and IrcChannels on disconnect, and have the NetworkModel items listen to the relevant destroyed() signals so they can do their cleanup. This saves us from sending lots of stuff over the network, and also should fix the assert (which we've replaced by a warning now, just in case). Fixes #1151 and a bunch of duplicates. ---