fixing client crash if a buffer is deleted during backlog rendering
[quassel.git] / src / client / client.cpp
index 457b5c0..d8e797b 100644 (file)
@@ -240,7 +240,8 @@ void Client::coreNetworkCreated(NetworkId id) {
 }
 
 void Client::coreNetworkRemoved(NetworkId id) {
-  if(!_networks.contains(id)) return;
+  if(!_networks.contains(id))
+    return;
   Network *net = _networks.take(id);
   emit networkRemoved(net->networkId());
   net->deleteLater();
@@ -615,10 +616,11 @@ void Client::removeBuffer(BufferId id) {
 }
 
 void Client::bufferRemoved(BufferId bufferId) {
-  // first remove the buffer from has. this prohibits further lastSeenUpdates
+  // first remove the buffer from hash. this prohibits further lastSeenUpdates
   Buffer *buff = 0;
   if(_buffers.contains(bufferId)) {
     buff = _buffers.take(bufferId);
+    layoutQueue.removeAll(buff);
     disconnect(buff, 0, this, 0);
   }