Skip to main content

Bug Tracker

Side navigation

#1285 closed bug (invalid)

Opened June 08, 2007 10:39PM UTC

Closed October 08, 2008 02:27PM UTC

Last modified March 15, 2012 01:01AM UTC

Draggable IE memory leak

Reported by: xoid Owned by: stefan
Priority: major Milestone: 1.1.3
Component: interface Version: 1.1.2
Keywords: Draggable IE memory leak Cc:
Blocked by: Blocking:
Description

When creating simple draggable element using Draggable(), memory leak detected for the draggable element itself and draghelper element.

Found using drip detector:

http://jgwebber.blogspot.com/2005/05/drip-ie-leak-detector.html

http://www.outofhanwell.com/ieleak/Drip-0.5.exe

Attachments (0)
Change History (4)

Changed June 08, 2007 11:22PM UTC by xoid comment:1

suggested patch:

--- interface 1.2/source/idrag.js       2007-02-08 09:13:48.000000000 -0500
+++ interface-1.2/source/idrag.js       2007-06-08 19:06:43.000000000 -0400
@@ -61,6 +61,11 @@
                        {
                                if (this.isDraggable) {
                                        this.dragCfg.dhe.unbind('mousedown', jQuery.iDrag.draginit);
+                                       this.dragCfg.dhe.each(
+                                               function(){
+                                                       this.dragElem = null;
+                                               }
+                                       );
                                        this.dragCfg = null;
                                        this.isDraggable = false;
                                        if(jQuery.browser.msie) {
@@ -70,6 +75,10 @@
                                                this.style.KhtmlUserSelect = '';
                                                this.style.userSelect = '';
                                        }
+                                       if (window.ActiveXObject) {
+                                               this.onselectstart = null;
+                                               this.ondragstart = null;
+                                       }
                                }
                        }
                );

Changed March 31, 2008 01:41AM UTC by scott.gonzal comment:2

resolution: → wontfix
status: newclosed

Interface is no longer supported; consider switching to jQuery UI.

Changed October 08, 2008 09:58AM UTC by Olsa comment:3

resolution: wontfix
status: closedreopened

I have the same problem with an application where I use ui.draggables/ui.dropples

and replace the draggables via AJAX.

Everytime after replacing or just removing the content, the Tool Drip (mentioned by xoid above)

tells me that the event-bindings of the dom nodes still exist.

I'm not able to remove the event-bindings. Neither with

droppable("destroy") nor with $("*").unbind().

Is there a memory leak or am I doing something wrong?

The Test-Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://ui.jquery.com/repository/
latest/jquery-1.2.6.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/
latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/
latest/ui/ui.droppable.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/
latest/ui/ui.draggable.js"></script>
<script type="text/javascript">
$(function(){
        $("#draggable").draggable();
        $("#droppable").droppable({
                accept: "#draggable",
                drop: function(ev, ui) {
                        alert("dropped");
                }
        });
        $("#removeIt").click(function(){
                //$("*").unbind();
                $("#draggable").draggable("destroy");
                $("#droppable").droppable("destroy");
                $("#draggable").remove();
        });
});

</script>

<style type="text/css">
#droppable,
#draggable{
        position:absolute;
        top:100px;
        left:400px;
        width:200px;
        height:200px;
        background-color:#CCFFCC;
        border:1px solid #f00;
}

#draggable{
        z-index:1;
        left:100px;
        background-color:#FFCC66;
}

</style>
</head>

<body>

<a href="#" id="removeIt">Remove Draggable</a>
<div id="draggable">Draggable</div>
<div id="droppable">Droppable</div>

</body>
</html> 

Changed October 08, 2008 02:27PM UTC by flesler comment:4

resolution: → invalid
status: reopenedclosed

Please repost this to the UI Bug Tracker.