1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

fixed crash bug

This commit is contained in:
kojima
1999-05-15 19:16:12 +00:00
parent 0607245378
commit 87c48374b7

View File

@@ -142,11 +142,13 @@ WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item)
if (tPtr->maxItems == tPtr->itemCount) { if (tPtr->maxItems == tPtr->itemCount) {
WMTabViewItem **items; WMTabViewItem **items;
items = wrealloc(tPtr->items, tPtr->maxItems + 10); items = wrealloc(tPtr->items,
sizeof(WMTabViewItem*) * (tPtr->maxItems + 10));
if (!items) { if (!items) {
wwarning("out of memory allocating memory for tabview"); wwarning("out of memory allocating memory for tabview");
return; return;
} }
memset(&items[tPtr->maxItems], 0, sizeof(WMTabViewItem*) * 10);
tPtr->items = items; tPtr->items = items;
tPtr->maxItems += 10; tPtr->maxItems += 10;
} }
@@ -507,6 +509,7 @@ destroyTabView(TabView *tPtr)
int i; int i;
for (i = 0; i < tPtr->itemCount; i++) { for (i = 0; i < tPtr->itemCount; i++) {
WMSetTabViewItemView(tPtr->items[i], NULL);
WMDestroyTabViewItem(tPtr->items[i]); WMDestroyTabViewItem(tPtr->items[i]);
} }
free(tPtr->items); free(tPtr->items);