fix memleak

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@520 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-30 09:42:18 +00:00
parent 97db619e99
commit 07383f6c62
4 changed files with 19 additions and 1 deletions

View File

@@ -192,6 +192,8 @@ static void frame_draw(MwWidget handle) {
int i;
MwPoint p;
int st = 0;
int ent;
int area;
r.x = 0;
r.y = 0;
@@ -203,7 +205,10 @@ static void frame_draw(MwWidget handle) {
st = get_first_entry(handle->parent, lb);
for(i = st; i < arrlen(lb->list) && i < st + (r.height - MwGetDefaultBorderWidth(handle) * 2) / MwTextHeight(handle, "M"); i++) {
area = r.height - MwGetDefaultBorderWidth(handle) * 2;
ent = area / MwTextHeight(handle, "M");
for(i = st; i < arrlen(lb->list) && i < st + ent; i++) {
int selected = lb->selected == i ? 1 : 0;
int j;