1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +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) {
WMTabViewItem **items;
items = wrealloc(tPtr->items, tPtr->maxItems + 10);
items = wrealloc(tPtr->items,
sizeof(WMTabViewItem*) * (tPtr->maxItems + 10));
if (!items) {
wwarning("out of memory allocating memory for tabview");
return;
}
memset(&items[tPtr->maxItems], 0, sizeof(WMTabViewItem*) * 10);
tPtr->items = items;
tPtr->maxItems += 10;
}
@@ -507,6 +509,7 @@ destroyTabView(TabView *tPtr)
int i;
for (i = 0; i < tPtr->itemCount; i++) {
WMSetTabViewItemView(tPtr->items[i], NULL);
WMDestroyTabViewItem(tPtr->items[i]);
}
free(tPtr->items);