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

List:       kde-bugs-dist
Subject:    Bug#10446: browsing around on www.pricewatch.com
From:       Harri Porten <harri () trolltech ! com>
Date:       2000-09-15 11:34:45
[Download RAW message or body]

I reduced this crash to a test case consisting of the files attach
below. The source of the problem: child window frame1 plants an object
into it's parent's window object (top.a = 99). When clicking on the link
frame1 gets replaced by frame2. Frame2 tries to access top.a but the
pointer is stale. Number(99) was registered frame1 and was removed by
its garbage collection.

That's a sincere problem. There are only two solutions I can think of
right now:

1.) don't garbage collect until all JS interpreters are deleted. This
might lead to quite some memory consumption in case one frame or window
stays open all the time.

2.) Combine the garbage collection with the former reference counting to
form a hybrid system. This reference counting would ensure that the
objects don't get deleted prematurely. The downside is the complexity of
this approach. The GC had made life so easy.

Harri.

============= index.html ==================
<HTML>
<HEAD>
</HEAD>
<SCRIPT>
// dummy
</SCRIPT>
<frameset cols="50%">
<frame name="Results" src="frame1.html">
</frameset>
</HTML>

============= frame1.html ==================
<HTML>
<HEAD>
<script>
top.a = 99;
</script>
</HEAD>
<BODY>
<a href="frame2.html">Click here.</a>
</BODY></HTML>

============= frame2.html ==================
<HTML>
<HEAD>
<script>
x = top.a;
</script>
</HEAD>
<BODY>
Came here without a crash ? Good. Test passed.
</BODY>
</HTML>

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

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