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

List:       kde-commits
Subject:    KDE/kdelibs/kjs
From:       Maks Orlovich <maksim () kde ! org>
Date:       2009-04-29 15:43:18
Message-ID: 1241019798.492240.6013.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 961179 by orlovich:

automatically merged revision 961165:
Fix a crash that can happen when closing last document part (which is much easier to trigger in 
akregator than konqueror) --- we need to mark the interned tables even if there are no 
interpreters alive, as interpreter destruction may preceed some GCs, including one 
that finally gets to the function body that's keeping the interned literal alive.

Thanks to Andras for report, and getting the VG data needed to fix it.

BUG:190966

 M  +2 -0      collector.cpp  
 M  +4 -1      interpreter.cpp  
 M  +7 -0      interpreter.h  


--- trunk/KDE/kdelibs/kjs/collector.cpp #961178:961179
@@ -668,6 +668,8 @@
     bool currentThreadIsMainThread = true;
 #endif
 
+  Interpreter::markSourceCachedObjects();
+
   if (Interpreter::s_hook) {
     Interpreter* scr = Interpreter::s_hook;
     do {
--- trunk/KDE/kdelibs/kjs/interpreter.cpp #961178:961179
@@ -756,7 +756,10 @@
     // tendenacy to pin blocks, increasing their number and hence spreading out
     // the objects somewhat
     m_numCachedActivations = 0;
-    
+}
+
+void Interpreter::markSourceCachedObjects()
+{
     markInternedStringsTable();
 }
 
--- trunk/KDE/kdelibs/kjs/interpreter.h #961178:961179
@@ -299,6 +299,13 @@
      * implementing custom mark methods must make sure to chain to this one.
      */
     virtual void mark(bool currentThreadIsMainThread);
+    
+    /**
+     * This marks all GC heap resources stored as optimizations;
+     * and which have their lifetime managed by the appropriate AST.
+     * It's static since code can survive the interpreter by a bit.
+     */
+    static void markSourceCachedObjects();
 
     /**
      * Provides a way to distinguish derived classes.
[prev in list] [next in list] [prev in thread] [next in thread] 

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