Skip to content

Commit

Permalink
v.7.1.1. - Fixed some memory leak issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nayfaan committed Oct 22, 2023
1 parent 0a08ea3 commit 1834028
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Searches for optimal puni feeding combination for Atelier Ryza 1

Hosted at https://nayfaan.github.io/puni_searching/

You can find a older implementation that runs on Python–Flask at https://github.com/nayfaan/puni_searching/tree/b1ae3a9a455ab78e827e39201a6d623b191a91bb
You can find an older implementation that runs on Python–Flask at https://github.com/nayfaan/puni_searching/tree/b1ae3a9a455ab78e827e39201a6d623b191a91bb
12 changes: 8 additions & 4 deletions web/static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var submit_button = $("#submit"),
range_checkbox = $("#range"),
ordered_checkbox = $("#ordered"),
results_table = $("#results-table");
var tbody;

function start_zip_worker() {
if (typeof (Worker) !== "undefined") {
Expand All @@ -11,6 +12,7 @@ function start_zip_worker() {
w.onmessage = function (event) {
if (event.data !== true) {
let [item_combo, total_score_unsorted, show_icons] = event.data
// @Todo: implement cooldown for print_result function
print_result(item_combo, total_score_unsorted, show_icons);
}
else conclude_calc();
Expand Down Expand Up @@ -76,11 +78,12 @@ function print_header(show_icons) {
$('<tbody>')
.attr('id', 'results')
);
thead_tr = null;

tbody = results_table.find('tbody');
}

function print_result(item_combo, total_score, show_icons) {
let tbody = results_table.find('tbody');

tbody.append(
$('<tr>')
.append(
Expand All @@ -101,7 +104,6 @@ function print_result(item_combo, total_score, show_icons) {

let item_add_attr = item_attr.filter(i => !item_orig_base_attr.includes(i))


let img;
if (show_icons) {
let img_src = "./web/static/images/items/" + item_name.toLowerCase().replace(/[\s']/g, "-") + ".webp"
Expand All @@ -126,6 +128,7 @@ function print_result(item_combo, total_score, show_icons) {
$('<td>')
.append(img));
}
img = null;

tr.append(
$('<td>')
Expand All @@ -147,6 +150,7 @@ function print_result(item_combo, total_score, show_icons) {
}

tbody.append(tr);
tr = null;
}

tbody
Expand Down Expand Up @@ -234,7 +238,7 @@ function cross_item_category_rank(item_category_matrix, best_only) {

function conclude_calc() {
stop_zip_worker();
let tbody = results_table.find('tbody');

tbody
.append(
$('<tr>')
Expand Down

0 comments on commit 1834028

Please sign in to comment.