[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    [Bug 89042] while pressing "del" key kate crashes (crash, bt)
From:       Andreas Kling <kling () impul ! se>
Date:       2006-06-23 14:06:17
Message-ID: 20060623140617.6947.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=89042         
kling impul se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From kling impul se  2006-06-23 16:06 -------
SVN commit 554198 by kling:

Remove nodes from `markedForDeleting' when deleting them now.
Fixes issues with cleanupUnneededNodes() working on dangling pointers.

BUG: 89042
BUG: 103648


 M  +17 -5     katecodefoldinghelpers.cpp  


--- branches/KDE/3.5/kdelibs/kate/part/katecodefoldinghelpers.cpp #554197:554198
 @ -559,7 +559,9  @
   uint endCol=node->endCol;
 
   // removes + deletes
-  delete parent->takeChild(mypos);
+  KateCodeFoldingNode *child = parent->takeChild(mypos);
+  markedForDeleting.removeRef(child);
+  delete child;
 
   if ((type>0) && (endLineValid))
     correctEndings(-type, parent, line+endLineRel/*+1*/,endCol, mypos); // why the \
hell did I add a +1 here ?  @ -583,7 +585,11  @
     // removes + deletes
     int i = parent->findChild (node);
     if (i >= 0)
-      delete parent->takeChild (i);
+    {
+      KateCodeFoldingNode *child = parent->takeChild(i);
+      markedForDeleting.removeRef(child);
+      delete child;
+    }
 
     return true;
   }
 @ -598,7 +604,9  @
       node->endLineValid = true;
       node->endLineRel = parent->child(i)->startLineRel - node->startLineRel;
 
-      delete parent->takeChild(i);
+      KateCodeFoldingNode *child = parent->takeChild(i);
+      markedForDeleting.removeRef(child);
+      delete child;
 
       count = i-mypos-1;
       if (count > 0)
 @ -831,7 +839,9  @
                 node->endLineValid = true;
                 node->endLineRel = getStartLine(parent->child(i))-line;
                 node->endCol = parent->child(i)->endCol;
-                delete parent->takeChild(i);
+                KateCodeFoldingNode *child = parent->takeChild(i);
+                markedForDeleting.removeRef( child );
+                delete child;
                 break;
               }
             }
 @ -907,7 +917,9  @
               count = node->childCount() - i - 1;
               newNode->endLineValid = true;
               newNode->endLineRel = line - getStartLine(node->child(i));
-              delete node->takeChild(i);
+              KateCodeFoldingNode *child = node->takeChild(i);
+              markedForDeleting.removeRef( child );
+              delete child;
               break;
             }
           }
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic