Patch: crash fix (was What if a html page uses a iframe for images?)

Koos Vriezen koos.vriezen at xs4all.nl
Thu Jul 29 21:42:04 BST 2004


On Wed, Jul 28, 2004 at 08:50:11PM +0200, Koos Vriezen wrote:
> On Wed, Jul 28, 2004 at 02:27:00PM +0200, Koos Vriezen wrote:
[..]
> Was playing with this on current:
> <html><head><script>
>             var frame;
>             function changeToImage (lnk) {
>                 frame=frames[0];
>                 frame.location = "image.jpg";
>                 func = changeToImage2;
>                 alert ("done1");
>             }
>             function changeToImage2 (lnk) {
>                 frame.location = "simple.html";
>                 func = changeToImage;
>                 alert ("done2");
>             }
>             var func = changeToImage;
>     </script></head>
>     <body>
>         <div onClick="javascript:func (this)">click me</div>
>         <iframe src="simple.html"</iframe>
>     </body>
> </html>
> 
> with mozilla it simply works but with konqueror after second click:
> [KCrash handler]
> #4  0x4155826f in QString::operator= ()
>    from /mnt/hda7/local/koos/kde/cvsup/qt-copy/lib/libqt-mt.so.3
> #5  0x4076483c in KURL::operator= () from /opt/kde-cvs/kde3/lib/libkdecore.so.4
> #6  0x40764997 in KURL::KURL () from /opt/kde-cvs/kde3/lib/libkdecore.so.4
> #7  0x41aaee7c in KJS::Window::goURL ()
>    from /opt/kde-cvs/kde3/lib/libkhtml.so.4
> #8  0x41ab1378 in KJS::Window::put () from /opt/kde-cvs/kde3/lib/libkhtml.so.4
> #9  0x41bcbc4b in KJS::Reference::putValue ()
>    from /opt/kde-cvs/kde3/lib/libkjs.so.1
> #10 0x41bcd328 in KJS::AssignNode::evaluate ()
>    from /opt/kde-cvs/kde3/lib/libkjs.so.1
> ...
> 
> So, its even worse than not functional.

KJS::Window::put didn't check for mpart being destroyed, David?

> > Koos
-------------- next part --------------
Index: ecma/kjs_window.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/ecma/kjs_window.cpp,v
retrieving revision 1.378
diff -u -3 -p -r1.378 kjs_window.cpp
--- ecma/kjs_window.cpp	19 Jun 2004 09:58:48 -0000	1.378
+++ ecma/kjs_window.cpp	29 Jul 2004 20:38:14 -0000
@@ -780,7 +780,7 @@ void Window::put(ExecState* exec, const 
   }
 
   const HashEntry* entry = Lookup::findEntry(&WindowTable, propertyName);
-  if (entry)
+  if (entry && !m_part.isNull())
   {
 #ifdef KJS_VERBOSE
     kdDebug(6070) << "Window("<<this<<")::put " << propertyName.qstring() << endl;


More information about the kfm-devel mailing list