Skip to content

AUI_DECLARATIVE_FOR bugs #716

@Alex2772

Description

@Alex2772

Crash on scrolling/unfolding of treeview implemention based on AUI_DECLARATIVE_FOR

@malik1988 thank you, I confirm the crash. Please give me some time to investigate the issue.

(sry for long response)

You're welcome.
I might have found the problem. I won't create a PR for now because my connection to GitHub is very unstable.
Here are the changes:

  1. first is in contentTree function has to treat empty for nodes, already updated in TreeView Project name 'aui.example.tree'
  2. after that a crash will still occur. The reason for this error is that the size of mCache and views are inconsistent. The specific fix is as follows:
//codes in aui.views/src/AUI/View/AForEachUI.cpp  line: 299

void AForEachUIBase::addView(List::iterator iterator, AOptional<std::size_t> index) {
    if (!mCache) {
        mCache.emplace();
    } else {
        AUI_ASSERT(getViews().size() == mCache->items.size());
    }
    Cache::LazyListItemInfo entry { *iterator };
    if (index) {
        AViewContainerBase::addView(*index, entry.view);
    } else {
        AViewContainerBase::addView(entry.view);
    }
    auto at = mCache->items.end();
    if (index) {
        at = mCache->items.begin() + *index;
    }
    entry.iterator = std::move(iterator);
    mCache->items.insert(at, std::move(entry));
}

Originally posted by @malik1988 in #706

Memory leak

Found memory leak in large lists.

  • Make a test for infinite range and verify that views are destructed
  • Fix the memory leak
  • Validate the repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    3: Moderate Complexity

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions