LP#1086458: clear util.list lists and trees during cleanup
authorGalen Charlton <gmc@esilibrary.com>
Thu, 24 Jan 2013 20:16:52 +0000 (15:16 -0500)
committerBen Shum <bshum@biblio.org>
Mon, 4 Mar 2013 19:49:33 +0000 (14:49 -0500)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/server/patron/bill2.js
Open-ILS/xul/staff_client/server/patron/bill_details.js
Open-ILS/xul/staff_client/server/patron/bill_history.js
Open-ILS/xul/staff_client/server/patron/hold_details.js
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/info_group.js
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/search_result.js
Open-ILS/xul/staff_client/server/patron/staged.js
Open-ILS/xul/staff_client/server/patron/standing_penalties.js
Open-ILS/xul/staff_client/server/patron/summary.js

index 10d6748..a9af71d 100644 (file)
@@ -68,6 +68,7 @@ function my_cleanup() {
     try {
         window.bill_event_listeners.removeAll();
         g.bill_list.cleanup();
+        g.bill_list.clear();
     } catch(E) {
         var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/bill2.xul', E]);
         try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
index fbb519f..cb5f3c2 100644 (file)
@@ -252,7 +252,9 @@ function my_init() {
 function my_cleanup() {
     try {
         g.bill_list.cleanup();
+        g.bill_list.clear();
         g.payment_list.cleanup();
+        g.payment_list.clear();
         window.bill_details_event_listeners.removeAll();
     } catch(E) {
         try { g.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.bill_details.my_cleanup.error'),E); } catch(F) { alert(E); }
index e1365cd..d897f6f 100644 (file)
@@ -288,7 +288,9 @@ function my_init() {
 function my_cleanup() {
     try {
         g.bill_list.cleanup();
+        g.bill_list.clear();
         g.payments_list.cleanup();
+        g.payments_list.clear();
         window.bill_history_event_listeners.removeAll();
     } catch(E) {
         var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/bill_history.xul', E]);
index f583094..edf4359 100644 (file)
@@ -32,6 +32,7 @@ function my_init() {
 function my_cleanup() {
     try {
         g.list.cleanup();
+        g.list.clear();
     } catch(E) {
         try { g.error.standard_unexpected_error_alert('/xul/server/patron/hold_notices.xul',E); } catch(E) { alert('FIXME: ' + js2JSON(E)); }
     }
index eaa29c4..c90e28f 100644 (file)
@@ -1637,6 +1637,7 @@ patron.holds.prototype = {
         var obj = this;
         obj.controller.cleanup();
         obj.list.cleanup();
+        obj.list.clear();
         obj.event_listeners.removeAll();
     },
 
index a9407ce..bf30c84 100644 (file)
@@ -32,6 +32,7 @@ function my_init() {
 function my_cleanup() {
     try {
         list.cleanup();
+        list.clear();
     } catch(E) {
         var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/info_group.xul', E]);
         try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
index 64d244d..a2fc061 100644 (file)
@@ -228,7 +228,9 @@ patron.items.prototype = {
     'cleanup' : function() {
         var obj = this;
         obj.list.cleanup();
+        obj.list.clear();
         obj.list2.cleanup();
+        obj.list2.clear();
     },
 
     'show_noncats' : function() {
index 8a77a71..49c4522 100644 (file)
@@ -190,6 +190,7 @@ patron.search_result.prototype = {
         var obj = this;
         obj.controller.cleanup();
         obj.list.cleanup();
+        obj.list.clear();
     },
 
     'search' : function(query) {
index 246a57d..8909555 100644 (file)
@@ -53,6 +53,7 @@ function staged_init() {
 function staged_cleanup() {
     try {
         list.cleanup();
+        list.clear();
         window.staged_event_listeners.removeAll();
     } catch(E) {
         var err_prefix = 'staged.js -> staged_cleanup() : ';
index 7b9f714..7a1786f 100644 (file)
@@ -48,7 +48,9 @@ function penalty_cleanup() {
     try {
         window.standing_penalties_event_listeners.removeAll();
         list.cleanup();
+        list.clear();
         archived_list.cleanup();
+        archived_list.clear();
     } catch(E) {
         var err_prefix = 'standing_penalties.js -> penalty_cleanup() : ';
         if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
index 6b73ff9..e560b64 100644 (file)
@@ -933,8 +933,14 @@ patron.summary.prototype = {
 
     'cleanup' : function() {
         var obj = this;
-        if (typeof obj.group_list != 'undefined') obj.group_list.cleanup();
-        if (typeof obj.stat_cat_list != 'undefined') obj.stat_cat_list.cleanup();
+        if (typeof obj.group_list != 'undefined') {
+            obj.group_list.cleanup();
+            obj.group_list.clear();
+        }
+        if (typeof obj.stat_cat_list != 'undefined') {
+            obj.stat_cat_list.cleanup();
+            obj.stat_cat_list.clear();
+        }
         obj.controller.cleanup();
         obj.event_listeners.removeAll();
     },