From 5e31934651e0aacc0c98f361e54fe3d8664134df Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 24 Jan 2013 15:16:52 -0500 Subject: [PATCH] LP#1086458: clear util.list lists and trees during cleanup Signed-off-by: Galen Charlton Signed-off-by: Ben Shum --- Open-ILS/xul/staff_client/server/patron/bill2.js | 1 + .../xul/staff_client/server/patron/bill_details.js | 2 ++ .../xul/staff_client/server/patron/bill_history.js | 2 ++ .../xul/staff_client/server/patron/hold_details.js | 1 + Open-ILS/xul/staff_client/server/patron/holds.js | 1 + Open-ILS/xul/staff_client/server/patron/info_group.js | 1 + Open-ILS/xul/staff_client/server/patron/items.js | 2 ++ .../xul/staff_client/server/patron/search_result.js | 1 + Open-ILS/xul/staff_client/server/patron/staged.js | 1 + .../staff_client/server/patron/standing_penalties.js | 2 ++ Open-ILS/xul/staff_client/server/patron/summary.js | 10 ++++++++-- 11 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 10d6748c76..a9af71d7ca 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -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); } diff --git a/Open-ILS/xul/staff_client/server/patron/bill_details.js b/Open-ILS/xul/staff_client/server/patron/bill_details.js index fbb519f603..cb5f3c2949 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_details.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_details.js @@ -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); } diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.js b/Open-ILS/xul/staff_client/server/patron/bill_history.js index e1365cd4be..d897f6f780 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.js @@ -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]); diff --git a/Open-ILS/xul/staff_client/server/patron/hold_details.js b/Open-ILS/xul/staff_client/server/patron/hold_details.js index f583094c16..edf4359bdc 100644 --- a/Open-ILS/xul/staff_client/server/patron/hold_details.js +++ b/Open-ILS/xul/staff_client/server/patron/hold_details.js @@ -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)); } } diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index eaa29c43e8..c90e28f31e 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -1637,6 +1637,7 @@ patron.holds.prototype = { var obj = this; obj.controller.cleanup(); obj.list.cleanup(); + obj.list.clear(); obj.event_listeners.removeAll(); }, diff --git a/Open-ILS/xul/staff_client/server/patron/info_group.js b/Open-ILS/xul/staff_client/server/patron/info_group.js index a9407ce657..bf30c84662 100644 --- a/Open-ILS/xul/staff_client/server/patron/info_group.js +++ b/Open-ILS/xul/staff_client/server/patron/info_group.js @@ -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); } diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index 64d244d179..a2fc0619be 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -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() { diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 8a77a71096..49c452228e 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -190,6 +190,7 @@ patron.search_result.prototype = { var obj = this; obj.controller.cleanup(); obj.list.cleanup(); + obj.list.clear(); }, 'search' : function(query) { diff --git a/Open-ILS/xul/staff_client/server/patron/staged.js b/Open-ILS/xul/staff_client/server/patron/staged.js index 246a57d161..8909555afb 100644 --- a/Open-ILS/xul/staff_client/server/patron/staged.js +++ b/Open-ILS/xul/staff_client/server/patron/staged.js @@ -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() : '; diff --git a/Open-ILS/xul/staff_client/server/patron/standing_penalties.js b/Open-ILS/xul/staff_client/server/patron/standing_penalties.js index 7b9f714034..7a1786f08b 100644 --- a/Open-ILS/xul/staff_client/server/patron/standing_penalties.js +++ b/Open-ILS/xul/staff_client/server/patron/standing_penalties.js @@ -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); diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index 6b73ff905c..e560b64602 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -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(); }, -- 2.43.2