From: Marcus Eggenberger Date: Mon, 4 Feb 2008 23:10:51 +0000 (+0000) Subject: fixed a major bug introduced in r456 (segfault on core exit) X-Git-Tag: 0.2.0-alpha1~121 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=4aca5963302eb2f6dfc41b723df4b362704f1b2b fixed a major bug introduced in r456 (segfault on core exit) --- diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 38959aa9..edb2c710 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -44,7 +44,6 @@ IrcChannel::IrcChannel(const QString &channelname, Network *network) } IrcChannel::~IrcChannel() { - } // ==================== @@ -143,7 +142,7 @@ void IrcChannel::setTopic(const QString &topic) { void IrcChannel::join(IrcUser *ircuser) { if(!_userModes.contains(ircuser) && ircuser) { _userModes[ircuser] = QString(); - ircuser->joinChannel(name()); + ircuser->joinChannel(this); //qDebug() << "JOIN" << name() << ircuser->nick() << ircUsers().count(); connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString))); connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed())); @@ -160,7 +159,7 @@ void IrcChannel::join(const QString &nick) { void IrcChannel::part(IrcUser *ircuser) { if(isKnownUser(ircuser)) { _userModes.remove(ircuser); - ircuser->partChannel(name()); + ircuser->partChannel(this); //qDebug() << "PART" << name() << ircuser->nick() << ircUsers().count(); // if you wonder why there is no counterpart to ircUserParted: // the joines are propagted by the ircuser. the signal ircUserParted is only for convenience @@ -242,7 +241,6 @@ void IrcChannel::initSetUserModes(const QVariantMap &usermodes) { } void IrcChannel::ircUserDestroyed() { - qDebug() << "IrcChannel::ircUserDestroyed()"; IrcUser *ircUser = static_cast(sender()); Q_ASSERT(ircUser); _userModes.remove(ircUser); diff --git a/src/common/ircuser.cpp b/src/common/ircuser.cpp index 99f2ae31..64f5d323 100644 --- a/src/common/ircuser.cpp +++ b/src/common/ircuser.cpp @@ -49,10 +49,6 @@ IrcUser::IrcUser(const QString &hostmask, Network *network) } IrcUser::~IrcUser() { - QList channels = _channels.toList(); - foreach(IrcChannel *channel, channels) { - partChannel(channel); - } } // ==================== diff --git a/src/common/network.cpp b/src/common/network.cpp index 8f5680be..17db37d9 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -218,7 +218,6 @@ IrcUser *Network::newIrcUser(const QString &hostmask) { connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString))); connect(ircuser, SIGNAL(initDone()), this, SLOT(ircUserInitDone())); - connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed())); _ircUsers[nick] = ircuser; emit ircUserAdded(hostmask); emit ircUserAdded(ircuser); @@ -498,17 +497,11 @@ void Network::ircChannelInitDone() { emit ircChannelInitDone(ircchannel); } -void Network::ircUserDestroyed() { - IrcUser *ircuser = static_cast(sender()); - Q_ASSERT(ircuser); - removeIrcUser(ircuser); -} - void Network::channelDestroyed() { IrcChannel *channel = static_cast(sender()); Q_ASSERT(channel); - emit ircChannelRemoved(sender()); _ircChannels.remove(_ircChannels.key(channel)); + emit ircChannelRemoved(channel); } void Network::requestConnect() const { diff --git a/src/common/network.h b/src/common/network.h index 19694302..d44319ca 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -164,7 +164,6 @@ public slots: void emitConnectionError(const QString &); private slots: - void ircUserDestroyed(); void channelDestroyed(); void removeIrcUser(IrcUser *ircuser); void ircUserInitDone(); diff --git a/version.inc b/version.inc index 94bca59d..81cc2488 100644 --- a/version.inc +++ b/version.inc @@ -4,15 +4,15 @@ { using namespace Global; quasselVersion = "0.2.0-pre"; - quasselDate = "2008-02-04"; - quasselBuild = 458; + quasselDate = "2008-02-05"; + quasselBuild = 459; //! Minimum client build number the core needs - clientBuildNeeded = 456; + clientBuildNeeded = 459; clientVersionNeeded = quasselVersion; //! Minimum core build number the client needs - coreBuildNeeded = 456; + coreBuildNeeded = 459; coreVersionNeeded = quasselVersion; }