Update of /cvsroot/qooxdoo/qooxdoo/source/script/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6586/source/script/core
Modified Files:
Tag: renderer
QxApplication.js QxObject.js QxTarget.js
Log Message:
Fixed many memory leaks, optimized some disposers, added missing dispose call for some events
Index: QxTarget.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxTarget.js,v
retrieving revision 1.2.2.34
retrieving revision 1.2.2.35
diff -u -d -r1.2.2.34 -r1.2.2.35
--- QxTarget.js 23 Jan 2006 12:28:53 -0000 1.2.2.34
+++ QxTarget.js 28 Jan 2006 18:19:24 -0000 1.2.2.35
@@ -243,7 +243,7 @@
Internal placeholder for bubbling phase of an event.
*/
proto.getParent = function() {
- return null;
+ return null;
};
@@ -267,14 +267,18 @@
{
for (var vType in this._listeners)
{
- for (var vKey in this._listeners[vType]) {
+ for (var vKey in this._listeners[vType])
+ {
+ this._listeners[vType][vKey] = null;
delete this._listeners[vType][vKey];
};
+ this._listeners[vType] = null;
delete this._listeners[vType];
};
};
+ this._listeners = null;
delete this._listeners;
return QxObject.prototype.dispose.call(this);
Index: QxApplication.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxApplication.js,v
retrieving revision 1.2.2.62
retrieving revision 1.2.2.63
diff -u -d -r1.2.2.62 -r1.2.2.63
--- QxApplication.js 28 Jan 2006 12:28:34 -0000 1.2.2.62
+++ QxApplication.js 28 Jan 2006 18:19:24 -0000 1.2.2.63
@@ -42,6 +42,21 @@
window.application.init();
};
+function QxApplicationWidgetInit()
+{
+ var s = (new Date).valueOf();
+ var a = window.application;
+
+ a.info("Widget phase");
+ a.debug("Rendering widgets");
+
+ a._ready = true;
+ QxWidget.flushGlobalQueues(true);
+
+ a.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
+ a._initPostload();
+};
+
function QxApplicationUnload()
{
window.application.dispose();
@@ -210,20 +225,7 @@
this.createDispatchEvent(QxConst.EVENT_TYPE_CACHE);
// Finally flushing the queues with a timeout of 100ms
- window.setTimeout(function()
- {
- var s = (new Date).valueOf();
- var a = window.application;
-
- a.info("Widget phase");
- a.debug("Rendering widgets");
-
- a._ready = true;
- QxWidget.flushGlobalQueues(true);
-
- a.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
- a._initPostload();
- }, 100);
+ // window.setTimeout(QxApplicationWidgetInit, 100);
}
catch(ex)
{
@@ -231,6 +233,8 @@
};
this.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
+
+ QxApplicationWidgetInit();
};
proto._initPostload = function()
Index: QxObject.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxObject.js,v
retrieving revision 1.2.2.36
retrieving revision 1.2.2.37
diff -u -d -r1.2.2.36 -r1.2.2.37
--- QxObject.js 27 Jan 2006 15:32:02 -0000 1.2.2.36
+++ QxObject.js 28 Jan 2006 18:19:24 -0000 1.2.2.37
@@ -42,11 +42,8 @@
{
this._hashCode = QxObjectCounter++;
- if (vAutoDispose != false)
- {
- try {
- QxObjectDataBase.push(this);
- } catch(ex) {};
+ if (vAutoDispose != false) {
+ QxObjectDataBase.push(this);
};
};
@@ -379,10 +376,22 @@
this._data = null;
};
- this._disposed = true;
-
// Delete Entry from Object DB
QxObjectDataBase[this._hashCode] = null;
+ delete QxObjectDataBase[this._hashCode];
+
+ // Finally cleanup the other stuff
+ for (var obj in this)
+ {
+ if (typeof this[obj] == QxConst.TYPEOF_OBJECT)
+ {
+ this[obj] = null;
+ delete this[obj];
+ };
+ };
+
+ // Mark as disposed
+ this._disposed = true;
};
/*!
|