fix: fix desktop app loading cap
This commit is contained in:
@@ -174,7 +174,18 @@ static void launcher_add_item(DesktopState* ds, LauncherItemKind kind,
|
||||
SvgIcon* icon, int ref_index,
|
||||
const char* path = nullptr,
|
||||
const char* keywords = nullptr) {
|
||||
if (ds->launcher_item_count >= MAX_LAUNCHER_ITEMS) return;
|
||||
if (ds->launcher_item_count >= ds->launcher_item_capacity) {
|
||||
int new_cap = ds->launcher_item_capacity ? ds->launcher_item_capacity * 2 : 64;
|
||||
auto* items = (LauncherItem*)montauk::realloc(
|
||||
ds->launcher_items, (uint64_t)new_cap * sizeof(LauncherItem));
|
||||
if (!items) return;
|
||||
ds->launcher_items = items;
|
||||
auto* results = (int*)montauk::realloc(
|
||||
ds->launcher_results, (uint64_t)new_cap * sizeof(int));
|
||||
if (!results) return;
|
||||
ds->launcher_results = results;
|
||||
ds->launcher_item_capacity = new_cap;
|
||||
}
|
||||
|
||||
LauncherItem* item = &ds->launcher_items[ds->launcher_item_count++];
|
||||
montauk::memset(item, 0, sizeof(LauncherItem));
|
||||
|
||||
Reference in New Issue
Block a user