fixed a major bug introduced in r456 (segfault on core exit)
authorMarcus Eggenberger <egs@quassel-irc.org>
Mon, 4 Feb 2008 23:10:51 +0000 (23:10 +0000)
committerMarcus Eggenberger <egs@quassel-irc.org>
Mon, 4 Feb 2008 23:10:51 +0000 (23:10 +0000)
src/common/ircchannel.cpp
src/common/ircuser.cpp
src/common/network.cpp
src/common/network.h
version.inc

index 38959aa..edb2c71 100644 (file)
@@ -44,7 +44,6 @@ IrcChannel::IrcChannel(const QString &channelname, Network *network)
 }
 
 IrcChannel::~IrcChannel() {
 }
 
 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();
 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()));
     //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);
 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
     //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() {
 }
 
 void IrcChannel::ircUserDestroyed() {
-  qDebug() << "IrcChannel::ircUserDestroyed()";
   IrcUser *ircUser = static_cast<IrcUser *>(sender());
   Q_ASSERT(ircUser);
   _userModes.remove(ircUser);
   IrcUser *ircUser = static_cast<IrcUser *>(sender());
   Q_ASSERT(ircUser);
   _userModes.remove(ircUser);
index 99f2ae3..64f5d32 100644 (file)
@@ -49,10 +49,6 @@ IrcUser::IrcUser(const QString &hostmask, Network *network)
 }
 
 IrcUser::~IrcUser() {
 }
 
 IrcUser::~IrcUser() {
-  QList<IrcChannel *> channels = _channels.toList();
-  foreach(IrcChannel *channel, channels) {
-    partChannel(channel);
-  }
 }
 
 // ====================
 }
 
 // ====================
index 8f5680b..17db37d 100644 (file)
@@ -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(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);
     _ircUsers[nick] = ircuser;
     emit ircUserAdded(hostmask);
     emit ircUserAdded(ircuser);
@@ -498,17 +497,11 @@ void Network::ircChannelInitDone() {
   emit ircChannelInitDone(ircchannel);
 }
 
   emit ircChannelInitDone(ircchannel);
 }
 
-void Network::ircUserDestroyed() {
-  IrcUser *ircuser = static_cast<IrcUser *>(sender());
-  Q_ASSERT(ircuser);
-  removeIrcUser(ircuser);
-}
-
 void Network::channelDestroyed() {
   IrcChannel *channel = static_cast<IrcChannel *>(sender());
   Q_ASSERT(channel);
 void Network::channelDestroyed() {
   IrcChannel *channel = static_cast<IrcChannel *>(sender());
   Q_ASSERT(channel);
-  emit ircChannelRemoved(sender());
   _ircChannels.remove(_ircChannels.key(channel));
   _ircChannels.remove(_ircChannels.key(channel));
+  emit ircChannelRemoved(channel);
 }
 
 void Network::requestConnect() const {
 }
 
 void Network::requestConnect() const {
index 1969430..d44319c 100644 (file)
@@ -164,7 +164,6 @@ public slots:
   void emitConnectionError(const QString &);
 
 private slots:
   void emitConnectionError(const QString &);
 
 private slots:
-  void ircUserDestroyed();
   void channelDestroyed();
   void removeIrcUser(IrcUser *ircuser);
   void ircUserInitDone();
   void channelDestroyed();
   void removeIrcUser(IrcUser *ircuser);
   void ircUserInitDone();
index 94bca59..81cc248 100644 (file)
@@ -4,15 +4,15 @@
 { using namespace Global;
 
   quasselVersion = "0.2.0-pre";
 { 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
 
   //! Minimum client build number the core needs
-  clientBuildNeeded = 456;
+  clientBuildNeeded = 459;
   clientVersionNeeded = quasselVersion;
 
   //! Minimum core build number the client needs
   clientVersionNeeded = quasselVersion;
 
   //! Minimum core build number the client needs
-  coreBuildNeeded = 456;
+  coreBuildNeeded = 459;
   coreVersionNeeded = quasselVersion;
 
 }
   coreVersionNeeded = quasselVersion;
 
 }