Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying to Dup Memory Leak

4 views
Skip to first unread message

mike

unread,
Oct 17, 2005, 1:28:54 PM10/17/05
to
In a previous post I talked about what I thought was a memory leak
based on some responses I was getting.

I configured this page below to simulate adding and then deleting rows
dynamically from the page except I can't duplicate the problem.

Here is the example: http://www.hulenbend.net/parent.html

Press the "X" to delete the row. In the page I am developing I get a
"Internet Explorer needs to Close message" after deleting about 14
rows.

Only main difference between this and the real page is that the names
have been changed to protect the innocent and that some of the
functions do not exist.

Anyone have this problem and how did you get around it?

MIke

mike

unread,
Oct 17, 2005, 4:18:00 PM10/17/05
to
I clicked on the debug button and I could see this data:

The thread 'Win32 Thread' (0xad8) has exited with code 0 (0x0).
Unhandled exception at 0x7c918fea in iexplore.exe: 0xC0000005:
Access violation writing location 0x00000010.

7C918FEA inc dword ptr [eax+10h]

ntdll.dll!7c918fea()

Does this info give any clues to anyone?

Also, this is a cf site using NT with IIS and authentication using
Siteminder.

Any help is appreciated.

Mike

VK

unread,
Oct 17, 2005, 8:22:46 PM10/17/05
to
> Here is the example: http://www.hulenbend.net/parent.html
>
> Press the "X" to delete the row. In the page I am developing I get a
> "Internet Explorer needs to Close message" after deleting about 14
> rows.

The bug is here (you should always post the code, getting external .js
files is boring):
...
function delThisRow(del_num) {
var mydelactionwin;
var mycgi = "/cgi-bin/child.cgi?num=" + del_num;
if ( !mydelactionwin || mydelactionwin.closed ) {
mydelactionwin = window.open(args);
}
mydelactionwin.focus();
}
...

You are declaring a local mydelactionwin variable w/o assignment, so
!mydelactionwin condition is always true, so the whole if-block is
pointless. Your problem is not in the amount of the deleted rows but in
your clicking speed. With enough of speed you're forcing mydelactionwin
to point to several directions (objects) at once including
non-more-existing ones. IE traditionally hates the latter and it gets
crazy. Under an old Win98/233Mhz laptop your script gets dead slow but
it works stable just because I cannot click quick enough with my frozen
mouse :-)

As your mydelactionwin state depends on server-side response you may:
1) Declare mydelactionwin as global variable and lock click actions
until mydelactionwin.closed is true.
2) Create a click buffer and process click by click checking
mydelactionwin.closed each time.

P.S. Standard Ctrl-Click / Shift-Click options to handle multiple rows
at once would be greate. Combining it with the option 1) you're getting
the most convenient and reliable solution (within JavaScript of
course).

mike

unread,
Oct 18, 2005, 12:39:47 PM10/18/05
to
Vk, thanks you're right about mydelactionwin. It should be a global
variable.

My solution however was to replace the window.open with creating an
iframe with the src="" and then change it to a valid script that does
the delete from the db, if the data is sucessfully deleted, I'll delete
the row from the parent form.

I finished this up this morning. It works like a champ and there are no
"Internet Explorer needs to Close message" messages.

I am very pleased with it. Thanks for your post.

0 new messages